summaryrefslogtreecommitdiff
path: root/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'load.c')
-rw-r--r--load.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/load.c b/load.c
index e4dd1e47ba..19d0849bc7 100644
--- a/load.c
+++ b/load.c
@@ -752,8 +752,15 @@ load_iseq_eval(rb_execution_context_t *ec, VALUE fname)
VALUE error = pm_load_parse_file(&result, fname, NULL);
if (error == Qnil) {
- iseq = pm_iseq_new_top(&result.node, rb_fstring_lit("<top (required)>"), fname, realpath_internal_cached(realpath_map, fname), NULL);
+ int error_state;
+ iseq = pm_iseq_new_top(&result.node, rb_fstring_lit("<top (required)>"), fname, realpath_internal_cached(realpath_map, fname), NULL, &error_state);
+
pm_parse_result_free(&result);
+
+ if (error_state) {
+ RUBY_ASSERT(iseq == NULL);
+ rb_jump_tag(error_state);
+ }
}
else {
rb_vm_pop_frame(ec);