Skip to content

Commit 469c907

Browse files
committed
---
yaml --- r: 1718 b: refs/heads/master c: 8c48fae h: refs/heads/master v: v3
1 parent 6f7fc18 commit 469c907

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9c0c0af1b225bc26c0b73434221efe6ffbb373c3
2+
refs/heads/master: 8c48fae72631720c8edd8cf0fb58de44e7978538

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3596,7 +3596,9 @@ fn trans_cast(@block_ctxt cx, @ast.expr e, &ast.ann ann) -> result {
35963596
auto t = node_ann_type(cx.fcx.ccx, ann);
35973597
auto lldsttype = type_of(cx.fcx.ccx, t);
35983598
if (!ty.type_is_fp(t)) {
3599-
if (llvm.LLVMGetIntTypeWidth(lldsttype) >
3599+
if (ty.type_is_native(ty.expr_ty(e))) {
3600+
e_res.val = e_res.bcx.build.PtrToInt(e_res.val, lldsttype);
3601+
} else if (llvm.LLVMGetIntTypeWidth(lldsttype) >
36003602
llvm.LLVMGetIntTypeWidth(llsrctype)) {
36013603
if (ty.type_is_signed(t)) {
36023604
// Widening signed cast.

0 commit comments

Comments
 (0)