Skip to content

Commit a7188a6

Browse files
committed
rustc: Don't sign extend uints during translation
Doing so produces incorrect results on a 32-bit compiler targeting 64-bits
1 parent f47f922 commit a7188a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@ fn store_temp_expr(cx: @block_ctxt, action: copy_action, dst: ValueRef,
21242124
fn trans_crate_lit(cx: @crate_ctxt, lit: ast::lit) -> ValueRef {
21252125
alt lit.node {
21262126
ast::lit_int(i) { ret C_int(cx, i); }
2127-
ast::lit_uint(u) { ret C_int(cx, u as int); }
2127+
ast::lit_uint(u) { ret C_uint(cx, u); }
21282128
ast::lit_mach_int(tm, i) {
21292129
// FIXME: the entire handling of mach types falls apart
21302130
// if target int width is larger than host, at the moment;

0 commit comments

Comments
 (0)