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:
parent
f10eb2c363
commit
34e61ca92b
3
eval.c
3
eval.c
@ -755,6 +755,9 @@ rb_raise_jump(VALUE mesg, VALUE cause)
|
|||||||
void
|
void
|
||||||
rb_jump_tag(int tag)
|
rb_jump_tag(int tag)
|
||||||
{
|
{
|
||||||
|
if (UNLIKELY(tag < TAG_RETURN || tag > TAG_FATAL)) {
|
||||||
|
unknown_longjmp_status(tag);
|
||||||
|
}
|
||||||
JUMP_TAG(tag);
|
JUMP_TAG(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +258,9 @@ sysexit_status(VALUE err)
|
|||||||
return NUM2INT(st);
|
return NUM2INT(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define unknown_longjmp_status(status) \
|
||||||
|
rb_bug("Unknown longjmp status %d", status)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
error_handle(int ex)
|
error_handle(int ex)
|
||||||
{
|
{
|
||||||
@ -314,7 +317,7 @@ error_handle(int ex)
|
|||||||
error_print();
|
error_print();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rb_bug("Unknown longjmp status %d", ex);
|
unknown_longjmp_status(ex);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rb_threadptr_reset_raised(th);
|
rb_threadptr_reset_raised(th);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user