summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2015-07-13 07:08:01 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2015-07-13 11:07:59 +0900
commit9c311ddc938ad2cc88e4119374e47cd496e15a94 (patch)
tree12589cca2f3b80cb16ad072b17e020ecd5003daa /src/error.c
parent4dac03cb2d53227bde2e5f50e70ca79596807e11 (diff)
downloadmruby-9c311ddc938ad2cc88e4119374e47cd496e15a94.tar.gz
mruby-9c311ddc938ad2cc88e4119374e47cd496e15a94.zip
refactor mrb_bob_missing to share raising NoMethodError code; fix #2878
Note: arguments of mrb_no_method_error() has changed. You need to replace 3rd and 4th argument (say n, argv) to mrb_ary_new_from_values(mrb, n, argv).
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/error.c b/src/error.c
index a800f77f9..20c63bd43 100644
--- a/src/error.c
+++ b/src/error.c
@@ -424,15 +424,14 @@ mrb_sys_fail(mrb_state *mrb, const char *mesg)
}
MRB_API mrb_noreturn void
-mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_int argc, const mrb_value *argv, char const* fmt, ...)
+mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_value args, char const* fmt, ...)
{
mrb_value exc;
va_list ap;
va_start(ap, fmt);
exc = mrb_funcall(mrb, mrb_obj_value(E_NOMETHOD_ERROR), "new", 3,
- mrb_vformat(mrb, fmt, ap), mrb_symbol_value(id),
- mrb_ary_new_from_values(mrb, argc, argv));
+ mrb_vformat(mrb, fmt, ap), mrb_symbol_value(id), args);
va_end(ap);
mrb_exc_raise(mrb, exc);
}