Skip to content

Commit 8256be4

Browse files
authored
fix JuliaLang#35391, macro hygiene bug in gc_preserve (JuliaLang#35394)
1 parent b1ceadc commit 8256be4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/macroexpand.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
,(resolve-expansion-vars-with-new-env (caddr arg) env m parent-scope inarg))))
341341
(else
342342
`(global ,(resolve-expansion-vars-with-new-env arg env m parent-scope inarg))))))
343-
((using import export meta line inbounds boundscheck loopinfo gc_preserve gc_preserve_end) (map unescape e))
343+
((using import export meta line inbounds boundscheck loopinfo) (map unescape e))
344344
((macrocall) e) ; invalid syntax anyways, so just act like it's quoted.
345345
((symboliclabel) e)
346346
((symbolicgoto) e)

test/syntax.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,3 +2223,9 @@ end
22232223
h35201(x; k=1) = (x, k)
22242224
f35201(c) = h35201((;c...), k=true)
22252225
@test f35201(Dict(:a=>1,:b=>3)) === ((a=1,b=3), true)
2226+
2227+
# issue #35391
2228+
macro a35391(b)
2229+
:(GC.@preserve ($(esc(b)),) )
2230+
end
2231+
@test @a35391(0) === (0,)

0 commit comments

Comments
 (0)