Minor test adjustments.

This commit is contained in:
Daniel Kirchner 2022-12-21 23:07:27 +01:00
parent 6a655bb0dd
commit 1f0f77aa95
3 changed files with 13 additions and 9 deletions

View File

@ -1042,6 +1042,7 @@ jobs:
environment: environment:
EVM: "shanghai" EVM: "shanghai"
SOLTEST_FLAGS: "--eof-version 1" SOLTEST_FLAGS: "--eof-version 1"
BOOST_TEST_ARGS: "-t sem*"
steps: steps:
- run: - run:
name: Build evmone based on EOF branch name: Build evmone based on EOF branch

View File

@ -17,7 +17,7 @@ contract C {
// EVMVersion: >=byzantium // EVMVersion: >=byzantium
// ---- // ----
// constructor(), 20 wei // constructor(), 20 wei
// gas irOptimized: 184005 // gas irOptimized: 179697
// gas legacy: 294335 // gas legacy: 294335
// gas legacyOptimized: 173427 // gas legacyOptimized: 173427
// f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a // f(uint256): 20 -> 0x137aa4dfc0911524504fcd4d98501f179bc13b4a

View File

@ -10,13 +10,15 @@ function adjustContractCodeForArgSize(bytes memory x, uint16 argSize)
{ {
assembly { assembly {
let memPos := add(x, 32) let memPos := add(x, 32)
let numCodeSections := shr(240, mload(add(memPos, 7))) if eq(shr(232, mload(memPos)), 0xef0001) {
let dataSectionSizeOffset := add(memPos, add(10, mul(numCodeSections, 2))) let numCodeSections := shr(240, mload(add(memPos, 7)))
let tmp := mload(dataSectionSizeOffset) let dataSectionSizeOffset := add(memPos, add(10, mul(numCodeSections, 2)))
let dataSectionSize := shr(240, tmp) let tmp := mload(dataSectionSizeOffset)
dataSectionSize := add(dataSectionSize, argSize) let dataSectionSize := shr(240, tmp)
if gt(dataSectionSize, 0xFFFF) { revert(0,0) } dataSectionSize := add(dataSectionSize, argSize)
mstore(dataSectionSizeOffset, or(shr(16, shl(16, tmp)), shl(240, dataSectionSize))) if gt(dataSectionSize, 0xFFFF) { revert(0,0) }
mstore(dataSectionSizeOffset, or(shr(16, shl(16, tmp)), shl(240, dataSectionSize)))
}
} }
} }
@ -43,4 +45,5 @@ contract C {
// compileViaYul: also // compileViaYul: also
// ---- // ----
// createDSalted(bytes32,uint256): 42, 64 -> // createDSalted(bytes32,uint256): 42, 64 ->
// gas legacy: 104365 // gas irOptimized: 100021
// gas legacy: 104455