Skip to content

Commit 92163f1

Browse files
committed
Windows x64 ABI requires i128 params to be passed as reference
1 parent ca73aff commit 92163f1

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/librustc_trans/cabi_x86_win64.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@ use type_::Type;
1818

1919
pub fn compute_abi_info(ccx: &CrateContext, fty: &mut FnType) {
2020
let fixup = |a: &mut ArgType| {
21-
if a.ty.kind() == Struct {
22-
match llsize_of_alloc(ccx, a.ty) {
23-
1 => a.cast = Some(Type::i8(ccx)),
24-
2 => a.cast = Some(Type::i16(ccx)),
25-
4 => a.cast = Some(Type::i32(ccx)),
26-
8 => a.cast = Some(Type::i64(ccx)),
27-
_ => a.make_indirect(ccx)
28-
}
29-
} else {
30-
a.extend_integer_width_to(32);
21+
match a.ty.kind() {
22+
Struct => match llsize_of_alloc(ccx, a.ty) {
23+
1 => a.cast = Some(Type::i8(ccx)),
24+
2 => a.cast = Some(Type::i16(ccx)),
25+
4 => a.cast = Some(Type::i32(ccx)),
26+
8 => a.cast = Some(Type::i64(ccx)),
27+
_ => a.make_indirect(ccx)
28+
},
29+
Integer => match llsize_of_alloc(ccx, a.ty) {
30+
1 ... 8 => a.extend_integer_width_to(32),
31+
16 => a.make_indirect(ccx),
32+
_ => bug!(),
33+
},
34+
_ => (),
3135
}
3236
};
3337

0 commit comments

Comments
 (0)