From 92163f1c5e73cd8430276ba738d2cc3bca116163 Mon Sep 17 00:00:00 2001 From: est31 Date: Sat, 10 Dec 2016 22:18:01 +0100 Subject: [PATCH] Windows x64 ABI requires i128 params to be passed as reference --- src/librustc_trans/cabi_x86_win64.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/librustc_trans/cabi_x86_win64.rs b/src/librustc_trans/cabi_x86_win64.rs index 71ecb6e9ca10..a849f3824738 100644 --- a/src/librustc_trans/cabi_x86_win64.rs +++ b/src/librustc_trans/cabi_x86_win64.rs @@ -18,16 +18,20 @@ use type_::Type; pub fn compute_abi_info(ccx: &CrateContext, fty: &mut FnType) { let fixup = |a: &mut ArgType| { - if a.ty.kind() == Struct { - match llsize_of_alloc(ccx, a.ty) { - 1 => a.cast = Some(Type::i8(ccx)), - 2 => a.cast = Some(Type::i16(ccx)), - 4 => a.cast = Some(Type::i32(ccx)), - 8 => a.cast = Some(Type::i64(ccx)), - _ => a.make_indirect(ccx) - } - } else { - a.extend_integer_width_to(32); + match a.ty.kind() { + Struct => match llsize_of_alloc(ccx, a.ty) { + 1 => a.cast = Some(Type::i8(ccx)), + 2 => a.cast = Some(Type::i16(ccx)), + 4 => a.cast = Some(Type::i32(ccx)), + 8 => a.cast = Some(Type::i64(ccx)), + _ => a.make_indirect(ccx) + }, + Integer => match llsize_of_alloc(ccx, a.ty) { + 1 ... 8 => a.extend_integer_width_to(32), + 16 => a.make_indirect(ccx), + _ => bug!(), + }, + _ => (), } };