Permalink
Browse files

Exception#initialize to take arbitrary number of args; ref #3384

  • Loading branch information...
matz committed Jan 11, 2017
1 parent c4491e4 commit 7523cdf3404230213cb858f38bd91135d478a7f3
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/error.c
View
@@ -44,8 +44,10 @@ static mrb_value
exc_initialize(mrb_state *mrb, mrb_value exc)
{
mrb_value mesg;
int argc;

This comment has been minimized.

Show comment
Hide comment
@clayton-shopify

clayton-shopify Jan 11, 2017

Contributor

@matz After this commit, MRuby built with MRB_INT64 segfaults as soon as it starts. I think this should be mrb_int instead of int.

@clayton-shopify

clayton-shopify Jan 11, 2017

Contributor

@matz After this commit, MRuby built with MRB_INT64 segfaults as soon as it starts. I think this should be mrb_int instead of int.

mrb_value *argv;
if (mrb_get_args(mrb, "|o", &mesg) == 1) {
if (mrb_get_args(mrb, "|o*", &mesg, &argv, &argc) >= 1) {
mrb_iv_set(mrb, exc, mrb_intern_lit(mrb, "mesg"), mesg);
}
return exc;

0 comments on commit 7523cdf

Please sign in to comment.