Skip to content

Commit

Permalink
fix #30048, lowering gc_preserve of closure variables (#30051)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Nov 19, 2018
1 parent ff74f6b commit 8a4f20b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -3893,8 +3893,9 @@ f(x) = yt(x)
'(null))

((gc_preserve_begin)
(let ((s (make-ssavalue)))
(emit `(= ,s ,e))
(let ((s (make-ssavalue))
(args (compile-args (cdr e) break-labels linearize-args)))
(emit `(= ,s ,(cons (car e) args)))
s))

;; metadata expressions
Expand Down
15 changes: 15 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,21 @@ end
# we don't parse chains of these since the associativity and meaning aren't clear
@test_throws ParseError Meta.parse("1..2..3")

# issue #30048
@test Meta.isexpr(Meta.lower(@__MODULE__, :(for a in b
c = try
try
d() do
if GC.@preserve c begin
end
end
end
finally
end
finally
end
end)), :thunk)

# issue #28506
@test Meta.isexpr(Meta.parse("1,"), :incomplete)
@test Meta.isexpr(Meta.parse("1, "), :incomplete)
Expand Down

2 comments on commit 8a4f20b

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.