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

* signal.c (trap_handler): trap("SIGSEGV", "DEFAULT") may cause wrong

trap error because SIG_DFL may be zero.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-06-15 09:58:10 +00:00
parent e3dd9a78db
commit cebc9bb19d
2 changed files with 13 additions and 7 deletions

View file

@ -1,6 +1,11 @@
Fri Jun 15 18:56:52 2007 Tanaka Akira <akr@fsij.org>
* signal.c (trap_handler): trap("SIGSEGV", "DEFAULT") may cause wrong
trap error because SIG_DFL may be zero.
Fri Jun 15 15:55:55 2007 Koichi Sasada <ko1@atdot.net>
* insns.def(setconstant, toregexp): fix to mark object correctly.
* insns.def (setconstant, toregexp): fix to mark object correctly.
Fri Jun 15 13:24:18 2007 Koichi Sasada <ko1@atdot.net>

View file

@ -634,10 +634,15 @@ struct trap_arg {
VALUE cmd;
};
static RETSIGTYPE
wrong_trap(int sig)
{
}
static sighandler_t
trap_handler(VALUE *cmd)
{
sighandler_t func = 0;
sighandler_t func = wrong_trap;
VALUE command;
if (NIL_P(*cmd)) {
@ -674,7 +679,7 @@ trap_handler(VALUE *cmd)
}
break;
}
if (!func) {
if (func == wrong_trap) {
rb_raise(rb_eArgError, "wrong trap - %s", RSTRING_PTR(command));
}
}
@ -1047,14 +1052,10 @@ Init_signal(void)
#endif
#ifdef SIGBUS
# ifndef RUBY_GC_STRESS
install_sighandler(SIGBUS, sigbus);
# endif
#endif
#ifdef SIGSEGV
# ifndef RUBY_GC_STRESS
install_sighandler(SIGSEGV, sigsegv);
# endif
#endif
#ifdef SIGPIPE
install_sighandler(SIGPIPE, sigpipe);