From 95fe19c19e596446412626b048d950de6ce8c886 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 9 Dec 2018 17:08:14 +0100 Subject: prog: introduce strict parsing mode Over time we relaxed parsing to handle all kinds of invalid programs (excessive/missing args, wrong types, etc). This is useful when reading old programs from corpus. But this is harmful for e.g. reading test inputs as they can become arbitrary outdated. For runtests which creates additional problem of executing not what is actually written in the test (or at least what author meant). Add strict parsing mode that does not tolerate any errors. For now it just checks excessive syscall arguments. --- prog/any_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/any_test.go') diff --git a/prog/any_test.go b/prog/any_test.go index 3294e4aeb..19a32d060 100644 --- a/prog/any_test.go +++ b/prog/any_test.go @@ -50,7 +50,7 @@ func TestSquash(t *testing.T) { } for i, test := range tests { t.Run(fmt.Sprint(i), func(t *testing.T) { - p, err := target.Deserialize([]byte(test.prog)) + p, err := target.Deserialize([]byte(test.prog), Strict) if err != nil { t.Fatalf("failed to deserialize prog: %v", err) } -- cgit mrf-deployment