-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syntax: bad ssavalue / GC.@preserve
interaction
#30048
Comments
GC.@preserve
interactionGC.@preserve
interaction
cc @Keno since you implemented both SSAIR and |
Reduced to: for a in b
c = try
try
d() do
if GC.@preserve c begin
end
end
end
finally
end
finally
end
end |
You'd think so, but that error is from the SSA values the frontend generates, i.e. that's for @JeffBezanson |
@maleadt: in your reduction |
I've asked @vtjnash to write down some of the things he's said on the triage call about this but the high-level gist of it seems to be that from the compilers perspective I made the argument that GC.@preserve a[i] begin
# access `a[i]` here
end This should be equivalent to doing this: let tmp = a[i]
GC.@preserve tmp begin
# access `a[i]` here
end Note that there is no rewrite of the body to change |
Yeah, I noticed. This was an automatic testcase reduction though, so I didn't have any say in it 🙂 |
What magical tool do you use for that? |
It looks to me like the implementation of gc_preserve does in fact evaluate all its arguments, but the front-end macro for it requires all arguments to be symbols to be conservative. For example, it lets us mostly avoid the question of whether side-effects in the arguments are guaranteed to happen. |
C-Reduce with |
😂 |
Julia fails at parsing the following seemingly-legal function definition:
with this error message:
There is no error without the
GC.@preserve
block.Found at JuliaLang/Pkg.jl#902.
The text was updated successfully, but these errors were encountered: