Skip to content

fix #33227, lowering of empty goto loop at top level #33230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/jlfrontend.scm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
file line)))
(if (and (null? (cdadr (caddr th)))
(and (length= (lam:body th) 2)
;; 1-element body might be `return` or `goto` (issue #33227)
(return? (cadr (lam:body th)))
(let ((retval (cadadr (lam:body th))))
(or (and (pair? retval) (eq? (car retval) 'lambda))
(simple-atom? retval)))))
Expand Down
2 changes: 2 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1940,3 +1940,5 @@ function f33135(x::T) where {C1, T}
end
@test f33135(0) == 1

# issue #33227
@test Meta.isexpr(Meta.lower(Main, :((@label a; @goto a))), :thunk)