Skip to content

Commit 3d4bf5f

Browse files
committed
---
yaml --- r: 1724 b: refs/heads/master c: 3f2bae4 h: refs/heads/master v: v3
1 parent ea8eae3 commit 3d4bf5f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
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: e6b6d1b64589e077a8ba6e8c752eabd3cfec6755
2+
refs/heads/master: 3f2bae4449b6eac3e970b033763905da5bb3a4f1

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,8 +3585,11 @@ fn trans_cast(@block_ctxt cx, @ast.expr e, &ast.ann ann) -> result {
35853585
auto t = node_ann_type(cx.fcx.ccx, ann);
35863586
auto lldsttype = type_of(cx.fcx.ccx, t);
35873587
if (!ty.type_is_fp(t)) {
3588+
// TODO: native-to-native casts
35883589
if (ty.type_is_native(ty.expr_ty(e))) {
35893590
e_res.val = e_res.bcx.build.PtrToInt(e_res.val, lldsttype);
3591+
} else if (ty.type_is_native(t)) {
3592+
e_res.val = e_res.bcx.build.IntToPtr(e_res.val, lldsttype);
35903593
} else if (llvm.LLVMGetIntTypeWidth(lldsttype) >
35913594
llvm.LLVMGetIntTypeWidth(llsrctype)) {
35923595
if (ty.type_is_signed(t)) {

0 commit comments

Comments
 (0)