mruby-struct/struct.c: need to copy the argument array

Just in case for stack reallocations.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-05-25 08:50:06 +09:00
parent e05ac91217
commit de69190df5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ mrb_data_new(mrb_state *mrb, mrb_value self)
}
else {
mrb_int argc;
mrb_get_args(mrb, "*!", &vals, &argc);
mrb_get_args(mrb, "*", &vals, &argc);
if (n != argc) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "wrong number of arguments");
}
+1 -1
View File
@@ -328,7 +328,7 @@ mrb_struct_initialize(mrb_state *mrb, mrb_value self)
const mrb_value *argv;
mrb_int argc;
mrb_get_args(mrb, "*!", &argv, &argc);
mrb_get_args(mrb, "*", &argv, &argc);
return mrb_struct_initialize_withArg(mrb, argc, argv, self);
}