Skip to content

Commit 6d635d7

Browse files
JeffBezansonKristofferC
authored andcommitted
fix #35391, macro hygiene bug in gc_preserve (#35394)
(cherry picked from commit 8256be4)
1 parent 7f5adff commit 6d635d7

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
@@ -341,7 +341,7 @@
341341
,(resolve-expansion-vars-with-new-env (caddr arg) env m parent-scope inarg))))
342342
(else
343343
`(global ,(resolve-expansion-vars-with-new-env arg env m parent-scope inarg))))))
344-
((using import export meta line inbounds boundscheck loopinfo gc_preserve gc_preserve_end) (map unescape e))
344+
((using import export meta line inbounds boundscheck loopinfo) (map unescape e))
345345
((macrocall) e) ; invalid syntax anyways, so just act like it's quoted.
346346
((symboliclabel) e)
347347
((symbolicgoto) e)

test/syntax.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,3 +1984,9 @@ end == 1
19841984
h35201(x; k=1) = (x, k)
19851985
f35201(c) = h35201((;c...), k=true)
19861986
@test f35201(Dict(:a=>1,:b=>3)) === ((a=1,b=3), true)
1987+
1988+
# issue #35391
1989+
macro a35391(b)
1990+
:(GC.@preserve ($(esc(b)),) )
1991+
end
1992+
@test @a35391(0) === (0,)

0 commit comments

Comments
 (0)