summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-22 14:18:03 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-22 14:18:03 +0900
commit00f2144692cbad6ba8190235867f3964d2727246 (patch)
tree45ea21222ba22550bb0f1b52724decacf01e7036
parentfc557085d8b5e806232e3edca520d57877cb77dc (diff)
downloadmruby-00f2144692cbad6ba8190235867f3964d2727246.tar.gz
mruby-00f2144692cbad6ba8190235867f3964d2727246.zip
allocate object after mrb_get_args()
-rw-r--r--src/class.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/class.c b/src/class.c
index d336dcd0f..0a1327089 100644
--- a/src/class.c
+++ b/src/class.c
@@ -1076,8 +1076,8 @@ mrb_instance_new(mrb_state *mrb, mrb_value cv)
mrb_value *argv;
mrb_int argc;
- obj = mrb_instance_alloc(mrb, cv);
mrb_get_args(mrb, "*&", &argv, &argc, &blk);
+ obj = mrb_instance_alloc(mrb, cv);
mrb_funcall_with_block(mrb, obj, mrb_intern_lit(mrb, "initialize"), argc, argv, blk);
return obj;