From 8f59e9605f6b55d86d75fdd887df5633a0037503 Mon Sep 17 00:00:00 2001 From: Vladislav Volosnikov Date: Fri, 29 Nov 2024 20:59:07 +0100 Subject: [PATCH] Erase returndatapointer if CREATE reverted --- system-contracts/contracts/EvmEmulator.yul | 2 ++ system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul | 1 + 2 files changed, 3 insertions(+) diff --git a/system-contracts/contracts/EvmEmulator.yul b/system-contracts/contracts/EvmEmulator.yul index f9a9c0d75..80aabf562 100644 --- a/system-contracts/contracts/EvmEmulator.yul +++ b/system-contracts/contracts/EvmEmulator.yul @@ -1126,6 +1126,7 @@ object "EvmEmulator" { addr := 0 gasLeft := _saveReturndataAfterEVMCall(0, 0) resetEvmFrame() + _eraseReturndataPointer() } default { gasLeft, addr := _saveConstructorReturnGas() @@ -4174,6 +4175,7 @@ object "EvmEmulator" { addr := 0 gasLeft := _saveReturndataAfterEVMCall(0, 0) resetEvmFrame() + _eraseReturndataPointer() } default { gasLeft, addr := _saveConstructorReturnGas() diff --git a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul index 58736a58d..c52977309 100644 --- a/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul +++ b/system-contracts/evm-emulator/EvmEmulatorFunctions.template.yul @@ -1064,6 +1064,7 @@ function _executeCreate(offset, size, value, evmGasLeftOld, isCreate2, salt) -> addr := 0 gasLeft := _saveReturndataAfterEVMCall(0, 0) resetEvmFrame() + _eraseReturndataPointer() } default { gasLeft, addr := _saveConstructorReturnGas()