Skip to content

Commit

Permalink
fix #35391, macro hygiene bug in gc_preserve (#35394)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Apr 8, 2020
1 parent b1ceadc commit 8256be4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
,(resolve-expansion-vars-with-new-env (caddr arg) env m parent-scope inarg))))
(else
`(global ,(resolve-expansion-vars-with-new-env arg env m parent-scope inarg))))))
((using import export meta line inbounds boundscheck loopinfo gc_preserve gc_preserve_end) (map unescape e))
((using import export meta line inbounds boundscheck loopinfo) (map unescape e))
((macrocall) e) ; invalid syntax anyways, so just act like it's quoted.
((symboliclabel) e)
((symbolicgoto) e)
Expand Down
6 changes: 6 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2223,3 +2223,9 @@ end
h35201(x; k=1) = (x, k)
f35201(c) = h35201((;c...), k=true)
@test f35201(Dict(:a=>1,:b=>3)) === ((a=1,b=3), true)

# issue #35391
macro a35391(b)
:(GC.@preserve ($(esc(b)),) )
end
@test @a35391(0) === (0,)

0 comments on commit 8256be4

Please sign in to comment.