diff options
author | John Hawthorn <john@hawthorn.email> | 2022-01-29 06:11:10 -0800 |
---|---|---|
committer | John Hawthorn <john@hawthorn.email> | 2022-02-05 18:10:19 -0800 |
commit | c79d2e54748f52c5023b0a1ee441561df9826c17 (patch) | |
tree | 80ccc9c3d71761206e1440a1a734aa285f56bfc8 /load.c | |
parent | 3e6c6c74dd40280103e953b321e5804054707053 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5513
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) { |