diff --git a/asm/assembler_fuzz_test.go b/asm/assembler_fuzz_test.go index a5a8101..6aa46fa 100644 --- a/asm/assembler_fuzz_test.go +++ b/asm/assembler_fuzz_test.go @@ -105,15 +105,12 @@ func FuzzAssembleAMD64(f *testing.F) { } return } - // Determinism: a second parse-and-assemble from scratch must produce - // the same bytes, which also catches the assembler mutating the - // syntax tree it was handed. - file2, _ := parser.ParseWithOptions("fuzz_amd64.s", src, - parser.Options{Expand: true, IncludeDirs: fuzzIncludeDirs}) - if file2 == nil { - t.Fatal("the second ParseWithOptions returned a nil file") - } - img2, err2 := AssembleFile(file2) + // Determinism: a second assembly of the same file must produce the + // same bytes. One parse serves both runs, so any mutation the + // assembler makes to the syntax tree it was handed shows up as + // differing bytes, and the workers' footprint under the shared + // memory fence stays that of a single parse. + img2, err2 := AssembleFile(file) if err2 != nil { t.Fatalf("the second assembly failed where the first succeeded: %v", err2) }