Fix a bug
This commit is contained in:
parent
bf2c35f05d
commit
12e129579d
2 changed files with 4 additions and 2 deletions
|
@ -108,9 +108,8 @@ pub fn codegen_call<'a, 'tcx: 'a>(
|
||||||
args
|
args
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|arg| {
|
.map(|arg| {
|
||||||
let ty = arg.ty(&fx.mir.local_decls, fx.tcx);
|
|
||||||
let arg = ::base::trans_operand(fx, arg);
|
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)
|
arg.load_value(fx)
|
||||||
} else {
|
} else {
|
||||||
arg.force_stack(fx)
|
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 {
|
match layout.variants {
|
||||||
layout::Variants::Single { index } => {
|
layout::Variants::Single { index } => {
|
||||||
assert_eq!(index, *variant_index);
|
assert_eq!(index, *variant_index);
|
||||||
|
fx.bcx.ins().nop();
|
||||||
}
|
}
|
||||||
layout::Variants::Tagged { .. } => {
|
layout::Variants::Tagged { .. } => {
|
||||||
let ptr = place.place_field(fx, mir::Field::new(0));
|
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)
|
CValue::const_val(fx, niche.layout().ty, niche_value as u64 as i64)
|
||||||
};
|
};
|
||||||
niche.write_cvalue(fx, niche_llval);
|
niche.write_cvalue(fx, niche_llval);
|
||||||
|
} else {
|
||||||
|
fx.bcx.ins().nop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue