Hi,
Ruby 1.8.6
SignalException.new is supposed to take only one argument, correct? If so, there's a bug in signal.c. The arity prototype
is set to -1 for esignal_init and there's some unnecessary argc checking going on in the that function as well.
The upshot of this is that there's an arity bug:
SignalException.new # ArgumentError, need 1 argument
SignalException.new(1) # ok
SignalException.new(1,2) # ok, but should raise an ArgumentError
SignalException.new(1,2,3) # ArgumentError, too many arguments
Also, is SignalException#signo supposed to be a public getter method? If so, then line 261 needs to be changed:
rb_iv_set(self, "signo", INT2NUM(signo)) => Missing "@" symbol.
If that's changed, then line 1598 in eval.c will need an equivalent change.
Attached are a diff and a test case for a cleaned up version that fixes the arity bug. I haven't touched the
"signo" instance variable, however, since I'm not sure what the desired behavior is.
Regards,
Dan |