Skip to content

Commit

Permalink
Merge #516
Browse files Browse the repository at this point in the history
516: Add workaround for singlepass miscompilation on GetLocal. r=syrusakbary a=losfair



Co-authored-by: losfair <[email protected]>
  • Loading branch information
bors[bot] and losfair committed Jul 1, 2019
2 parents 5f42045 + c67405f commit 13c5f5e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/singlepass-backend/src/codegen_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,16 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
}
Operator::GetLocal { local_index } => {
let local_index = local_index as usize;
self.value_stack
.push((self.locals[local_index], LocalOrTemp::Local));
let ret = self.machine.acquire_locations(a, &[WpType::I64], false)[0];
Self::emit_relaxed_binop(
a,
&mut self.machine,
Assembler::emit_mov,
Size::S64,
self.locals[local_index],
ret,
);
self.value_stack.push((ret, LocalOrTemp::Temp));
}
Operator::SetLocal { local_index } => {
let local_index = local_index as usize;
Expand Down

0 comments on commit 13c5f5e

Please sign in to comment.