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

eval.c: check tag value

* eval.c (rb_jump_tag): paranoiac check of tag value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-19 00:25:45 +00:00
parent f10eb2c363
commit 34e61ca92b
2 changed files with 7 additions and 1 deletions

3
eval.c
View file

@ -755,6 +755,9 @@ rb_raise_jump(VALUE mesg, VALUE cause)
void
rb_jump_tag(int tag)
{
if (UNLIKELY(tag < TAG_RETURN || tag > TAG_FATAL)) {
unknown_longjmp_status(tag);
}
JUMP_TAG(tag);
}

View file

@ -258,6 +258,9 @@ sysexit_status(VALUE err)
return NUM2INT(st);
}
#define unknown_longjmp_status(status) \
rb_bug("Unknown longjmp status %d", status)
static int
error_handle(int ex)
{
@ -314,7 +317,7 @@ error_handle(int ex)
error_print();
break;
default:
rb_bug("Unknown longjmp status %d", ex);
unknown_longjmp_status(ex);
break;
}
rb_threadptr_reset_raised(th);