Skip to content

Commit

Permalink
fix #15186, regression in if lowering
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Feb 22, 2016
1 parent 1b27f62 commit a1cc25d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,7 @@ f(x) = yt(x)
(emit test)
(let ((v1 (compile (caddr e) break-labels value tail)))
(if val (emit `(= ,val ,v1)))
(if (and (not tail) (length> e 3) (not (equal? (cadddr e) '(null))))
(if (and (not tail) (or (length> e 3) val))
(emit end-jump))
(set-car! (cddr test) (make&mark-label))
(let ((v2 (if (length> e 3)
Expand Down
7 changes: 7 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3758,3 +3758,10 @@ module I13229
end
@test z == 10
end

# issue #15186
let ex = quote
$(if true; :(test); end)
end
@test ex.args[2] == :test
end

0 comments on commit a1cc25d

Please sign in to comment.