load_exec should return undef on syntax errors

This commit is contained in:
Yukihiro Matsumoto
2012-09-27 11:28:15 +09:00
parent 190fc76091
commit 7171e5aa18
+1 -1
View File
@@ -4866,7 +4866,7 @@ load_exec(mrb_state *mrb, parser_state *p, mrbc_context *c)
static const char msg[] = "syntax error";
mrb->exc = (struct RObject*)mrb_object(mrb_exc_new(mrb, E_SYNTAX_ERROR, msg, sizeof(msg) - 1));
mrb_parser_free(p);
return mrb_nil_value();
return mrb_undef_value();
}
}
n = mrb_generate_code(mrb, p);