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
(cherry picked from commit 8256be4)
  • Loading branch information
JeffBezanson authored and KristofferC committed Apr 10, 2020
1 parent 7f5adff commit 6d635d7
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 @@ -341,7 +341,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 @@ -1984,3 +1984,9 @@ end == 1
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 6d635d7

Please sign in to comment.