aboutsummaryrefslogtreecommitdiffstats
path: root/load.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-11-19 16:56:56 +0900
committerKoichi Sasada <ko1@atdot.net>2019-11-19 16:56:56 +0900
commita5fe08fdd9d11f12a6837291ee588ab933a823b6 (patch)
tree0c04efc593754f513ebc5ce04c4c8570176a714c /load.c
parentc53aec73ddf94bb9a06bead62c3bf58c5ba49bd3 (diff)
downloadruby-a5fe08fdd9d11f12a6837291ee588ab933a823b6.tar.gz
care about TAG_FATAL.
TAG_FATAL represents interpreter closing state and ec->errinfo contains FIXNUM (eTerminateSignal, etc). If we need to change the state, then errinfo is also changed because TAG_RAISE assumes that ec->errinfo contains a Exception object. Without this patch, TAG_FATAL is ignored and no ec->errinfo change so that it causes critical issue. [Bug #16177]
Diffstat (limited to 'load.c')
-rw-r--r--load.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/load.c b/load.c
index 5b27fd1cc1..7772e746f9 100644
--- a/load.c
+++ b/load.c
@@ -1034,7 +1034,10 @@ require_internal(rb_execution_context_t *ec, VALUE fname, int exception)
if (ftptr) load_unlock(RSTRING_PTR(path), !state);
if (state) {
- if (exception) {
+ if (state == TAG_FATAL) {
+ EC_JUMP_TAG(ec, state);
+ }
+ else if (exception) {
/* usually state == TAG_RAISE only, except for
* rb_iseq_load_iseq in load_iseq_eval case */
VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);