aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encoding.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-04-26 14:26:41 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-04-28 16:52:22 +0200
commitdcd4b58785fe71ff05ae045693f89b23b670ab28 (patch)
tree2461db908c5b12d0b2355c85f379ba07e9953108 /prog/encoding.go
parente3ecea2e7fc6b80cc715c596105f4cf890e7e2e6 (diff)
prog: make program parsing more permissive
Don't error on wrong vma with value in non strict mode. Add more tests and fix use of cmp package (prog.Syscall is not comparable anymore).
Diffstat (limited to 'prog/encoding.go')
-rw-r--r--prog/encoding.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/prog/encoding.go b/prog/encoding.go
index 9a06c6d4b..f99ff9d84 100644
--- a/prog/encoding.go
+++ b/prog/encoding.go
@@ -347,7 +347,8 @@ func (p *parser) parseArg(typ Type) (Arg, error) {
func (p *parser) parseArgImpl(typ Type) (Arg, error) {
if typ == nil && p.Char() != 'n' {
- return nil, fmt.Errorf("non-nil argument for nil type")
+ p.eatExcessive(true, "non-nil argument for nil type")
+ return nil, nil
}
switch p.Char() {
case '0':