From 6f9bc483840861e334fc5bdebda76f1853a90878 Mon Sep 17 00:00:00 2001 From: Dave Cheney Date: Wed, 21 Oct 2026 11:57:30 +1100 Subject: [PATCH] builder: match size tests to the CLI interpreter limit Commit 89d9e33b (interp: bail out of loops that iterate too many times) introduced a loop limit of 1000 for CLI builds. The size-test helper did not set the new option, so its limit remained zero. Use the CLI default so size tests measure the same initialization code as normal builds. --- builder/sizes_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/builder/sizes_test.go b/builder/sizes_test.go index 9ea8514530..39d3af3680 100644 --- a/builder/sizes_test.go +++ b/builder/sizes_test.go @@ -14,6 +14,7 @@ import ( "github.com/tinygo-org/tinygo/compileopts" "github.com/tinygo-org/tinygo/goenv" + "github.com/tinygo-org/tinygo/interp" ) var sema = make(chan struct{}, runtime.NumCPU()) @@ -310,13 +311,14 @@ func buildBinary(t *testing.T, targetString, pkgName string, trimPath bool) Buil func buildBinaryInDir(targetString, pkgName, opt, tmpdir string, trimPath bool) (BuildResult, error) { options := compileopts.Options{ - Target: targetString, - Opt: opt, - Semaphore: sema, - InterpTimeout: 60 * time.Second, - Debug: true, - VerifyIR: true, - TrimPath: trimPath, + Target: targetString, + Opt: opt, + Semaphore: sema, + InterpTimeout: 60 * time.Second, + InterpMaxLoopIterations: interp.DefaultMaxInterpBlockEntries, + Debug: true, + VerifyIR: true, + TrimPath: trimPath, } target, err := compileopts.LoadTarget(&options) if err != nil {