summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2022-01-29 06:11:10 -0800
committerJohn Hawthorn <john@hawthorn.email>2022-02-05 18:10:19 -0800
commitc79d2e54748f52c5023b0a1ee441561df9826c17 (patch)
tree80ccc9c3d71761206e1440a1a734aa285f56bfc8 /load.c
parent3e6c6c74dd40280103e953b321e5804054707053 (diff)
downloadruby-c79d2e54748f52c5023b0a1ee441561df9826c17.tar.gz
Fix TAG_THROW through require [Bug #18562]
Previously this was being incorrectly swapped with TAG_RAISE in the next line. This would end up checking the T_IMEMO throw_data to the exception handling (which calls Module#===). This happened to not break existing tests because Module#=== returned false when klass is NULL. This commit handles throw from require correctly by jumping to the tag retaining the TAG_THROW state.
Diffstat (limited to 'load.c')
-rw-r--r--load.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/load.c b/load.c
index a2b9da48fb..812fe2fe93 100644
--- a/load.c
+++ b/load.c
@@ -1155,7 +1155,7 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception, bool wa
if (ftptr) load_unlock(th2->vm, RSTRING_PTR(path), !state);
if (state) {
- if (state == TAG_FATAL) {
+ if (state == TAG_FATAL || state == TAG_THROW) {
EC_JUMP_TAG(ec, state);
}
else if (exception) {