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

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-01-11 09:51:52 +09:00
parent c4491e477b
commit 7523cdf340
+3 -1
View File
@@ -44,8 +44,10 @@ static mrb_value
exc_initialize(mrb_state *mrb, mrb_value exc)
{
mrb_value mesg;
int argc;
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;