mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fix a bug
This commit is contained in:
parent
bf2c35f05d
commit
12e129579d
@ -108,9 +108,8 @@ pub fn codegen_call<'a, 'tcx: 'a>(
|
||||
args
|
||||
.into_iter()
|
||||
.map(|arg| {
|
||||
let ty = arg.ty(&fx.mir.local_decls, fx.tcx);
|
||||
let arg = ::base::trans_operand(fx, arg);
|
||||
if let Some(_) = fx.cton_type(ty) {
|
||||
if let Some(_) = fx.cton_type(arg.layout().ty) {
|
||||
arg.load_value(fx)
|
||||
} else {
|
||||
arg.force_stack(fx)
|
||||
|
@ -185,6 +185,7 @@ fn trans_stmt<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx>, stmt: &Statement<'tcx
|
||||
match layout.variants {
|
||||
layout::Variants::Single { index } => {
|
||||
assert_eq!(index, *variant_index);
|
||||
fx.bcx.ins().nop();
|
||||
}
|
||||
layout::Variants::Tagged { .. } => {
|
||||
let ptr = place.place_field(fx, mir::Field::new(0));
|
||||
@ -212,6 +213,8 @@ fn trans_stmt<'a, 'tcx: 'a>(fx: &mut FunctionCx<'a, 'tcx>, stmt: &Statement<'tcx
|
||||
CValue::const_val(fx, niche.layout().ty, niche_value as u64 as i64)
|
||||
};
|
||||
niche.write_cvalue(fx, niche_llval);
|
||||
} else {
|
||||
fx.bcx.ins().nop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user