mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-26 15:11:37 +00:00
Fix register zeroing in emit_compare_and_swap.
This commit is contained in:
@ -2105,6 +2105,10 @@ impl X64FunctionCode {
|
||||
true,
|
||||
value_size,
|
||||
|a, m, addr| {
|
||||
// Memory moves with size < 32b do not zero upper bits.
|
||||
if memory_sz != Size::S32 && memory_sz != Size::S64 {
|
||||
a.emit_xor(Size::S32, Location::GPR(compare), Location::GPR(compare));
|
||||
}
|
||||
a.emit_mov(memory_sz, Location::Memory(addr, 0), Location::GPR(compare));
|
||||
a.emit_mov(stack_sz, Location::GPR(compare), ret);
|
||||
cb(a, m, compare, value);
|
||||
|
Reference in New Issue
Block a user