load_exec() no longer return fixnum value for no_exec; should close #1569

parent 08e6bd47
...@@ -5381,7 +5381,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c) ...@@ -5381,7 +5381,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
if (proc == NULL) { if (proc == NULL) {
static const char msg[] = "codegen error"; static const char msg[] = "codegen error";
mrb->exc = mrb_obj_ptr(mrb_exc_new(mrb, E_SCRIPT_ERROR, msg, sizeof(msg) - 1)); mrb->exc = mrb_obj_ptr(mrb_exc_new(mrb, E_SCRIPT_ERROR, msg, sizeof(msg) - 1));
return mrb_nil_value(); return mrb_undef_value();
} }
if (c) { if (c) {
if (c->dump_result) codedump_all(mrb, proc); if (c->dump_result) codedump_all(mrb, proc);
......
...@@ -212,11 +212,10 @@ load_file(mrb_state *mrb, struct mrbc_args *args) ...@@ -212,11 +212,10 @@ load_file(mrb_state *mrb, struct mrbc_args *args)
result = mrb_load_file_cxt(mrb, infile, c); result = mrb_load_file_cxt(mrb, infile, c);
if (need_close) fclose(infile); if (need_close) fclose(infile);
if (mrb_undef_p(result) || mrb_fixnum(result) < 0) {
mrbc_context_free(mrb, c); mrbc_context_free(mrb, c);
if (mrb_undef_p(result)) {
return mrb_nil_value(); return mrb_nil_value();
} }
mrbc_context_free(mrb, c);
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment