Garbage in upper 32 bits shouldn't propagate to I64ExtendI32U's result.

This commit is contained in:
losfair 2020-05-12 02:11:43 +08:00
parent 77de93ec0e
commit 51e085a7ba

View File

@ -4043,6 +4043,7 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
false,
)[0];
self.value_stack.push(ret);
Self::emit_relaxed_binop(
a,
&mut self.machine,
@ -4051,6 +4052,16 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
loc,
ret,
);
if let Location::Memory(base, off) = ret {
Self::emit_relaxed_binop(
a,
&mut self.machine,
Assembler::emit_mov,
Size::S32,
Location::Imm32(0),
Location::Memory(base, off + 4),
);
}
}
Operator::I64ExtendI32S => {
let loc =