mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
avoid accessing non-allocated memory; close #271
This commit is contained in:
+1
-5
@@ -1140,11 +1140,7 @@ mrb_f_raise(mrb_state *mrb, mrb_value self)
|
||||
|
||||
mrb_get_args(mrb, "*", &argv, &argc);
|
||||
if (argc == 0) {
|
||||
err = get_errinfo(mrb);
|
||||
if (!mrb_nil_p(err)) {
|
||||
argc = 1;
|
||||
argv[0] = err;
|
||||
}
|
||||
mrb_raise(mrb, mrb->eRuntimeError_class, "");
|
||||
}
|
||||
mrb_exc_raise(mrb, mrb_make_exception(mrb, argc, argv));
|
||||
return mrb_nil_value(); /* not reached */
|
||||
|
||||
Reference in New Issue
Block a user