interp: add 'max depth' parameter to limit cost

This commit is contained in:
Kenneth Bell
2023-09-11 15:10:50 +01:00
parent ed2a98c7d0
commit a73eac22f1
9 changed files with 48 additions and 34 deletions
+6 -5
View File
@@ -22,11 +22,12 @@ func TestTraceback(t *testing.T) {
// Build a small binary that only panics.
tmpdir := t.TempDir()
config, err := builder.NewConfig(&compileopts.Options{
GOOS: runtime.GOOS,
GOARCH: runtime.GOARCH,
Opt: "z",
InterpTimeout: time.Minute,
Debug: true,
GOOS: runtime.GOOS,
GOARCH: runtime.GOARCH,
Opt: "z",
InterpTimeout: time.Minute,
InterpMaxDepth: 10,
Debug: true,
})
if err != nil {
t.Fatal(err)