Skip to content

Commit

Permalink
Merge pull request #9952 from JuliaLang/kms/fix9947
Browse files Browse the repository at this point in the history
Fix #9947
  • Loading branch information
vtjnash committed Jan 30, 2015
2 parents bdf97f7 + 2d684a7 commit 51d5412
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,9 +878,10 @@ static Value *emit_intrinsic(intrinsic f, jl_value_t **args, size_t nargs,
emit_expr(args[2], ctx, false));
}
else if (t1 == t2 && llt1 == llt2 && llt1 != jl_pvalue_llvmt) {
ifelse_result = builder.CreateSelect(isfalse,
auto_unbox(args[3], ctx),
auto_unbox(args[2], ctx));
Value *x = auto_unbox(args[3], ctx);
ifelse_result = tpropagate(x, builder.CreateSelect(isfalse,
x,
auto_unbox(args[2], ctx)));
}
else {
Value *arg1 = boxed(emit_expr(args[3],ctx,false), ctx, expr_type(args[3],ctx));
Expand Down
10 changes: 10 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2113,3 +2113,13 @@ function test_wr()
@test wref[1].value == nothing
end
test_wr()

# issue #9947
function f9947()
if 1 == 0
1
else
min(UInt128(2),1)
end
end
@test f9947() == UInt128(1)

0 comments on commit 51d5412

Please sign in to comment.