Skip to content

Commit

Permalink
Remove check
Browse files Browse the repository at this point in the history
  • Loading branch information
gianbelinche committed Aug 30, 2024
1 parent f6b77f3 commit 065ce01
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
6 changes: 0 additions & 6 deletions system-contracts/contracts/EvmInterpreterLoop.template.yul
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
12 changes: 0 additions & 12 deletions system-contracts/contracts/EvmInterpreterPreprocessed.yul
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 065ce01

Please sign in to comment.