aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-12-09 17:08:14 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-12-10 16:37:01 +0100
commit95fe19c19e596446412626b048d950de6ce8c886 (patch)
tree4dc35d5dc26acf7a3fa78eafdda07bbd283b2bcc /pkg
parenta5efea3ec3e302da3fa01ca44604fe62aec49a79 (diff)
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.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/runtest/run.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go
index ebebbf250..cc5697b43 100644
--- a/pkg/runtest/run.go
+++ b/pkg/runtest/run.go
@@ -213,7 +213,7 @@ func (ctx *Context) parseProg(filename string) (*prog.Prog, map[string]bool, *ip
if err != nil {
return nil, nil, nil, fmt.Errorf("failed to read %v: %v", filename, err)
}
- p, err := ctx.Target.Deserialize(data)
+ p, err := ctx.Target.Deserialize(data, prog.Strict)
if err != nil {
return nil, nil, nil, fmt.Errorf("failed to deserialize %v: %v", filename, err)
}