Skip to content

Commit 4966ed4

Browse files
authored
fix #33243, stack overflow on global binding effects in generated function (#33257)
1 parent ad475e3 commit 4966ed4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/toplevel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ jl_value_t *jl_toplevel_eval_flex(jl_module_t *JL_NONNULL m, jl_value_t *e, int
621621
}
622622

623623
if (ptls->in_pure_callback) {
624-
jl_eval_errorf(m, "eval cannot be used in a generated function");
624+
jl_error("eval cannot be used in a generated function");
625625
}
626626

627627
jl_method_instance_t *mfunc = NULL;

test/staged.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,9 @@ end
292292
end
293293

294294
@test_throws ErrorException("syntax: local variable name \"x\" conflicts with an argument") f30284(1)
295+
296+
# issue #33243
297+
@generated function f33243()
298+
:(global x33243 = 2)
299+
end
300+
@test_throws ErrorException f33243()

0 commit comments

Comments
 (0)