check if an Exception instance has a "mesg" attribute #468

Merged
merged 1 commit into from Sep 12, 2012

2 participants

@ghost

fix the issue that "Exception.new.inspect" causes SIGSEGV.

Applying the patch, "Exception#inspect" returns the name of the class if an instance was initialized with no "message" argument. This behavior is compatible with CRuby.

% bin/mruby -e 'p Exception.new.inspect'
"Exception: Exception"
% bin/mruby -e 'p Exception.new("a").inspect'
"Exception: a"
% bin/mruby -e 'p RuntimeError.new.inspect'
"RuntimeError: RuntimeError"

% ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-openbsd]
% ruby -e 'p Exception.new.inspect'
"#<Exception: Exception>"
@tsahara tsahara check if an Exception instance has a "mesg" attribute
fix the issue that "Exception.new.inspect" causes SIGSEGV.
7a7f267
@matz matz merged commit 7500229 into mruby:master Sep 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment