From 065ce0116087833205ebc47f967949d09368f80b Mon Sep 17 00:00:00 2001 From: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:00:23 -0300 Subject: [PATCH] Remove check --- .../contracts/EvmInterpreterLoop.template.yul | 6 ------ .../contracts/EvmInterpreterPreprocessed.yul | 12 ------------ 2 files changed, 18 deletions(-) diff --git a/system-contracts/contracts/EvmInterpreterLoop.template.yul b/system-contracts/contracts/EvmInterpreterLoop.template.yul index 9fe08f42d..c6fba46c4 100644 --- a/system-contracts/contracts/EvmInterpreterLoop.template.yul +++ b/system-contracts/contracts/EvmInterpreterLoop.template.yul @@ -411,14 +411,8 @@ for { } true { } { size, sp := popStackItemWithoutCheck(sp) checkOverflow(destOffset, size, evmGasLeft) - checkOverflow(offset, size, evmGasLeft) - checkOverflow(add(offset, size), MEM_OFFSET_INNER(), evmGasLeft) checkMemOverflowByOffset(add(destOffset,size), evmGasLeft) - if gt(add(add(offset, size), MEM_OFFSET_INNER()), MAX_MEMORY_FRAME()) { - $llvm_AlwaysInline_llvm$_memsetToZero(add(destOffset, MEM_OFFSET_INNER()), size) - } - // dynamicGas = 3 * minimum_word_size + memory_expansion_cost // minimum_word_size = (size + 31) / 32 let dynamicGas := add(mul(3, shr(5, add(size, 31))), expandMemory(add(destOffset, size))) diff --git a/system-contracts/contracts/EvmInterpreterPreprocessed.yul b/system-contracts/contracts/EvmInterpreterPreprocessed.yul index c1ce65a83..5f2e8b602 100644 --- a/system-contracts/contracts/EvmInterpreterPreprocessed.yul +++ b/system-contracts/contracts/EvmInterpreterPreprocessed.yul @@ -1942,14 +1942,8 @@ object "EVMInterpreter" { size, sp := popStackItemWithoutCheck(sp) checkOverflow(destOffset, size, evmGasLeft) - checkOverflow(offset, size, evmGasLeft) - checkOverflow(add(offset, size), MEM_OFFSET_INNER(), evmGasLeft) checkMemOverflowByOffset(add(destOffset,size), evmGasLeft) - if gt(add(add(offset, size), MEM_OFFSET_INNER()), MAX_MEMORY_FRAME()) { - $llvm_AlwaysInline_llvm$_memsetToZero(add(destOffset, MEM_OFFSET_INNER()), size) - } - // dynamicGas = 3 * minimum_word_size + memory_expansion_cost // minimum_word_size = (size + 31) / 32 let dynamicGas := add(mul(3, shr(5, add(size, 31))), expandMemory(add(destOffset, size))) @@ -4906,14 +4900,8 @@ object "EVMInterpreter" { size, sp := popStackItemWithoutCheck(sp) checkOverflow(destOffset, size, evmGasLeft) - checkOverflow(offset, size, evmGasLeft) - checkOverflow(add(offset, size), MEM_OFFSET_INNER(), evmGasLeft) checkMemOverflowByOffset(add(destOffset,size), evmGasLeft) - if gt(add(add(offset, size), MEM_OFFSET_INNER()), MAX_MEMORY_FRAME()) { - $llvm_AlwaysInline_llvm$_memsetToZero(add(destOffset, MEM_OFFSET_INNER()), size) - } - // dynamicGas = 3 * minimum_word_size + memory_expansion_cost // minimum_word_size = (size + 31) / 32 let dynamicGas := add(mul(3, shr(5, add(size, 31))), expandMemory(add(destOffset, size)))