From ee9ddb18fc8b5a7cc0120a7960ced65ab88eed54 Mon Sep 17 00:00:00 2001 From: losfair Date: Thu, 6 Feb 2020 23:10:55 +0800 Subject: [PATCH] Fix singlepass miscompilation on `Operator::CallIndirect`. --- lib/singlepass-backend/src/codegen_x64.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/singlepass-backend/src/codegen_x64.rs b/lib/singlepass-backend/src/codegen_x64.rs index 27f79dc62a9..f003bbbc847 100644 --- a/lib/singlepass-backend/src/codegen_x64.rs +++ b/lib/singlepass-backend/src/codegen_x64.rs @@ -6314,7 +6314,7 @@ impl FunctionCodeGenerator for X64FunctionCode { ExceptionCode::Memory, |a| a.emit_conditional_trap(Condition::BelowEqual), ); - a.emit_mov(Size::S64, func_index, Location::GPR(table_count)); + a.emit_mov(Size::S32, func_index, Location::GPR(table_count)); a.emit_imul_imm32_gpr64(vm::Anyfunc::size() as u32, table_count); a.emit_add( Size::S64,