Skip to content

Commit ad13062

Browse files
committed
Patch external tests with a safe inline assembly annotation.
1 parent 62a997a commit ad13062

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

test/externalTests/ens.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function ens_test
4848
"${compile_only_presets[@]}"
4949
#ir-no-optimize # Compilation fails with "YulException: Variable var__945 is 1 slot(s) too deep inside the stack."
5050
#ir-optimize-evm-only # Compilation fails with "YulException: Variable var__945 is 1 slot(s) too deep inside the stack."
51-
#ir-optimize-evm+yul # Compilation fails with "YulException: Variable _5 is 1 too deep in the stack [ _5 usr$i usr$h _7 usr$scratch usr$k usr$f _4 usr$len usr$j_2 RET _2 _1 var_data_mpos usr$totallen usr$x _12 ]"
51+
ir-optimize-evm+yul # Needs memory-safe inline assembly patch
5252
legacy-optimize-evm-only
5353
legacy-optimize-evm+yul
5454
)
@@ -68,6 +68,8 @@ function ens_test
6868
replace_version_pragmas
6969
neutralize_packaged_contracts
7070

71+
find . -name "*.sol" -exec sed -i -e 's/^\(\s*\)\(assembly\)/\1\/\/\/ @solidity memory-safe-assembly\n\1\2/' '{}' \;
72+
7173
for preset in $SELECTED_PRESETS; do
7274
hardhat_run_test "$config_file" "$preset" "${compile_only_presets[*]}" compile_fn test_fn
7375
store_benchmark_report hardhat ens "$repo" "$preset"

test/externalTests/trident.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function trident_test
5656
"${compile_only_presets[@]}"
5757
#ir-no-optimize # Compilation fails with: "YulException: Variable var_amount_165 is 9 slot(s) too deep inside the stack."
5858
#ir-optimize-evm-only # Compilation fails with: "YulException: Variable var_amount_165 is 9 slot(s) too deep inside the stack."
59-
#ir-optimize-evm+yul # Compilation fails with: "YulException: Cannot swap Variable var_nearestTick with Variable _4: too deep in the stack by 4 slots"
59+
ir-optimize-evm+yul # Needs memory-safe inline assembly patch
6060
legacy-no-optimize
6161
legacy-optimize-evm-only
6262
legacy-optimize-evm+yul
@@ -87,6 +87,7 @@ function trident_test
8787
sed -i 's|uint32(-1)|type(uint32).max|g' contracts/flat/BentoBoxV1Flat.sol
8888
sed -i 's|IERC20(0)|IERC20(address(0))|g' contracts/flat/BentoBoxV1Flat.sol
8989
sed -i 's|IStrategy(0)|IStrategy(address(0))|g' contracts/flat/BentoBoxV1Flat.sol
90+
find contracts -name "*.sol" -exec sed -i -e 's/^\(\s*\)\(assembly\)/\1\/\/\/ @solidity memory-safe-assembly\n\1\2/' '{}' \;
9091

9192
# @sushiswap/core package contains contracts that get built with 0.6.12 and fail our compiler
9293
# version check. It's not used by tests so we can remove it.

0 commit comments

Comments
 (0)