From 7c68177f9d6d9752532b640bb11d3fe541055277 Mon Sep 17 00:00:00 2001 From: openhands Date: Wed, 18 Mar 2026 13:17:18 +0000 Subject: [PATCH] fix: add via_ir to temp forge project in transpiler tests The 30-way threshold lookup in optimizer_seed.push3 generates enough local variables to trigger "Stack too deep" without IR compilation. Add via_ir = true to the minimal foundry.toml created in both test scripts, matching the setting in onchain/foundry.toml. Co-Authored-By: Claude Sonnet 4.6 --- tools/push3-transpiler/test_inject_extraction.sh | 2 +- tools/push3-transpiler/test_transpiler_clamping.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/push3-transpiler/test_inject_extraction.sh b/tools/push3-transpiler/test_inject_extraction.sh index 2ed5610..4ddad5d 100755 --- a/tools/push3-transpiler/test_inject_extraction.sh +++ b/tools/push3-transpiler/test_inject_extraction.sh @@ -188,7 +188,7 @@ else else FORGE_DIR="$TMPDIR_I5/forge_verify" mkdir -p "$FORGE_DIR/src" - printf '[profile.default]\nsrc = "src"\nout = "out"\nlibs = []\n' > "$FORGE_DIR/foundry.toml" + printf '[profile.default]\nsrc = "src"\nout = "out"\nlibs = []\nvia_ir = true\n' > "$FORGE_DIR/foundry.toml" cp "$REPO_ROOT/onchain/src/IOptimizer.sol" "$FORGE_DIR/src/" cp "$SOL_OUT" "$FORGE_DIR/src/OptimizerV3Push3.sol" diff --git a/tools/push3-transpiler/test_transpiler_clamping.sh b/tools/push3-transpiler/test_transpiler_clamping.sh index 9fad527..48155c2 100755 --- a/tools/push3-transpiler/test_transpiler_clamping.sh +++ b/tools/push3-transpiler/test_transpiler_clamping.sh @@ -199,7 +199,7 @@ if [ -z "$FORGE_BIN" ]; then else FORGE_DIR="$TMPDIR_T/forge_verify" mkdir -p "$FORGE_DIR/src" - printf '[profile.default]\nsrc = "src"\nout = "out"\nlibs = []\n' > "$FORGE_DIR/foundry.toml" + printf '[profile.default]\nsrc = "src"\nout = "out"\nlibs = []\nvia_ir = true\n' > "$FORGE_DIR/foundry.toml" cp "$REPO_ROOT/onchain/src/IOptimizer.sol" "$FORGE_DIR/src/" cp "$OUTPUT_6" "$FORGE_DIR/src/OptimizerV3Push3.sol"