From b628bd0ad314cbe66ff902624c9d9e2c4cd1bb81 Mon Sep 17 00:00:00 2001 From: Kamen Stoykov Date: Fri, 30 Aug 2024 08:34:42 +0000 Subject: [PATCH] copy jump table before executing last opcode --- core/vm/interpreter_zkevm.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/vm/interpreter_zkevm.go b/core/vm/interpreter_zkevm.go index 1ac6eed7ec5..203d8019623 100644 --- a/core/vm/interpreter_zkevm.go +++ b/core/vm/interpreter_zkevm.go @@ -218,8 +218,9 @@ func (in *EVMInterpreter) RunZk(contract *Contract, input []byte, readOnly bool) // because pc and pcCopy can be different only if the main loop finishes normally without error // but is it finishes normally without error then "ret" != nil and the .execute below will never be invoked at all - overrideJumpTableForLastOpcode(in.jt, in.evm.ChainRules()) - in.jt[op].execute(pc, in, callContext) + jtForLastOpCode := copyJumpTable(in.jt) + overrideJumpTableForLastOpcode(jtForLastOpCode, in.evm.ChainRules()) + jtForLastOpCode[op].execute(pc, in, callContext) } }()