1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

load.c: stop separating exits at loading

* load.c (rb_load_internal0): stop separating exits at loading
  from exits from execution.  TAG_FATAL is the only case that
  `errinfo` is a Fixnum, and should continue to exit by JUMP_TAG
  but not raising as an ordinary exception.
  [ruby-core:70169] [Bug #11404]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-30 02:52:57 +00:00
parent bcba951320
commit 2735af4daf
2 changed files with 8 additions and 6 deletions

View file

@ -1,3 +1,11 @@
Thu Jul 30 11:52:55 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* load.c (rb_load_internal0): stop separating exits at loading
from exits from execution. TAG_FATAL is the only case that
`errinfo` is a Fixnum, and should continue to exit by JUMP_TAG
but not raising as an ordinary exception.
[ruby-core:70169] [Bug #11404]
Thu Jul 30 10:42:27 2015 Alex Dowad <alexinbeijing@gmail.com>
* load.c (rb_load_internal0): extra check before returning

6
load.c
View file

@ -579,7 +579,6 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
int state;
volatile VALUE wrapper = th->top_wrapper;
volatile VALUE self = th->top_self;
volatile int loaded = FALSE;
volatile int mild_compile_error;
#if !defined __GNUC__
rb_thread_t *volatile th0 = th;
@ -606,7 +605,6 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
th->mild_compile_error++;
node = (NODE *)rb_load_file_str(fname);
loaded = TRUE;
iseq = rb_iseq_new_top(node, rb_str_new2("<top (required)>"), fname, rb_realpath_internal(Qnil, fname, 1), NULL);
th->mild_compile_error--;
rb_iseq_eval(iseq);
@ -621,10 +619,6 @@ rb_load_internal0(rb_thread_t *th, VALUE fname, int wrap)
th->top_self = self;
th->top_wrapper = wrapper;
if (!loaded && !FIXNUM_P(th->errinfo) && state != TAG_THROW) {
/* an error on loading don't include INT2FIX(TAG_FATAL) see r35625 */
return TAG_RAISE;
}
if (state) {
VALUE exc = rb_vm_make_jump_tag_but_local_jump(state, Qundef);
if (NIL_P(exc)) return state;