mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
eval.c: static IDs
* eval.c (ruby_static_id_signo, ruby_static_id_status): add static IDs, signo and status. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
556515bf69
commit
0d20fbe3bd
5 changed files with 21 additions and 9 deletions
9
eval.c
9
eval.c
|
@ -24,6 +24,10 @@ NORETURN(void rb_raise_jump(VALUE, VALUE));
|
|||
VALUE rb_eLocalJumpError;
|
||||
VALUE rb_eSysStackError;
|
||||
|
||||
ID ruby_static_id_signo, ruby_static_id_status;
|
||||
#define id_signo ruby_static_id_signo
|
||||
#define id_status ruby_static_id_status
|
||||
|
||||
#define exception_error GET_VM()->special_exceptions[ruby_error_reenter]
|
||||
|
||||
#include "eval_error.c"
|
||||
|
@ -218,7 +222,7 @@ ruby_cleanup(volatile int ex)
|
|||
break;
|
||||
}
|
||||
else if (rb_obj_is_kind_of(err, rb_eSignal)) {
|
||||
VALUE sig = rb_iv_get(err, "signo");
|
||||
VALUE sig = rb_ivar_get(err, id_signo);
|
||||
state = NUM2INT(sig);
|
||||
break;
|
||||
}
|
||||
|
@ -1711,4 +1715,7 @@ Init_eval(void)
|
|||
rb_define_global_function("untrace_var", rb_f_untrace_var, -1); /* in variable.c */
|
||||
|
||||
rb_vm_register_special_exception(ruby_error_reenter, rb_eFatal, "exception reentered");
|
||||
|
||||
id_signo = rb_intern_const("signo");
|
||||
id_status = rb_intern_const("status");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue