You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix generated_body_to_codeinfo to avoid string (which is not always defined) (#57925)
Fixes a discrepancy between the code in C before #57230 and in Julia
afterwards, making sure to sequence these method definitions correctly.
Not sure how to write a reliable test since it is specific to when this
generated function is defined relative to the helpers used by this
thunk, but the issue/fix is visible with:
```
$ ./julia -e 'code_lowered(ntuple, (Returns{Nothing}, Val{1000000}))'
```
Fix#57301
Copy file name to clipboardExpand all lines: base/expr.jl
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1672,7 +1672,8 @@ function generated_body_to_codeinfo(ex::Expr, defmod::Module, isva::Bool)
1672
1672
ci =ccall(:jl_expand, Any, (Any, Any), ex, defmod)
1673
1673
if!isa(ci, CodeInfo)
1674
1674
ifisa(ci, Expr) && ci.head ===:error
1675
-
error("syntax: $(ci.args[1])")
1675
+
msg = ci.args[1]
1676
+
error(msg isa String ?strcat("syntax: ", msg) : msg)
1676
1677
end
1677
1678
error("The function body AST defined by this @generated function is not pure. This likely means it contains a closure, a comprehension or a generator.")
0 commit comments