From f8f619e676a9c568c10ac690b37f8b414cd0d52b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 15 Apr 2024 14:54:58 +0200 Subject: prog: don't require preallocated buffer for exec encoding If we send exec encoding to the fuzzer, it's not necessary to serialize exec encoding into existing buffer (currnetly we serialize directly into shmem). So simplify code by serializing into a new slice. --- prog/test_util.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'prog/test_util.go') diff --git a/prog/test_util.go b/prog/test_util.go index 71a52c809..eb15539ea 100644 --- a/prog/test_util.go +++ b/prog/test_util.go @@ -27,7 +27,6 @@ type DeserializeTest struct { func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target, *Prog), tests []DeserializeTest) { target := InitTargetTest(t, OS, arch) - buf := make([]byte, ExecBufferSize) for testidx, test := range tests { t.Run(fmt.Sprint(testidx), func(t *testing.T) { if test.StrictErr == "" { @@ -75,7 +74,7 @@ func TestDeserializeHelper(t *testing.T, OS, arch string, transform func(*Target if want != output && want != outputVerbose { t.Fatalf("wrong serialized data:\n%s\nexpect:\n%s\n", outputVerbose, want) } - p.SerializeForExec(buf) + p.SerializeForExec() } } }) -- cgit mrf-deployment