diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-03-15 21:16:13 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-03-17 21:19:13 +0100 |
| commit | 924f7606047a430a9b313c135b782e1e8f852bec (patch) | |
| tree | 649fbf186af5268815f16884875f92d948ad57b0 /prog/encoding_test.go | |
| parent | 5de34a784c610ab08888c185dd0c09f542d62d4f (diff) | |
pkg/compiler: ensure consistency of syscall argument types
Ensure that we don't have conflicting sizes for the same argument
of the same syscall, e.g.:
foo$1(a int16)
foo$2(a int32)
This is useful for several reasons:
- we will be able avoid morphing syscalls into other syscalls
- we will be able to figure out more precise sizes for args
(lots of them are implicitly intptr, which is the largest
type on most important arches)
- found few bugs in linux descriptions
Update #477
Update #502
Diffstat (limited to 'prog/encoding_test.go')
| -rw-r--r-- | prog/encoding_test.go | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/prog/encoding_test.go b/prog/encoding_test.go index c62e6647f..fda0f855f 100644 --- a/prog/encoding_test.go +++ b/prog/encoding_test.go @@ -162,19 +162,19 @@ func TestDeserialize(t *testing.T) { input: `test$regression2(&(0x7f0000000000)=[0x1, 0x2, 0x3, 0x4, 0x5, 0x6])`, }, { - input: `test$excessive_args1(0x0, 0x1, {0x1, &(0x7f0000000000)=[0x1, 0x2]})`, + input: `test_excessive_args1(0x0, 0x1, {0x1, &(0x7f0000000000)=[0x1, 0x2]})`, strictErr: "excessive syscall arguments", }, { - input: `test$excessive_args2(0x0, 0x1, {0x1, &(0x7f0000000000)={0x1, 0x2}})`, + input: `test_excessive_args2(0x0, 0x1, {0x1, &(0x7f0000000000)={0x1, 0x2}})`, strictErr: "excessive syscall arguments", }, { - input: `test$excessive_args2(0x0, 0x1, {0x1, &(0x7f0000000000)=nil})`, + input: `test_excessive_args2(0x0, 0x1, {0x1, &(0x7f0000000000)=nil})`, strictErr: "excessive syscall arguments", }, { - input: `test$excessive_args2(0x0, &(0x7f0000000000), 0x0)`, + input: `test_excessive_args2(0x0, &(0x7f0000000000), 0x0)`, strictErr: "excessive syscall arguments", }, { @@ -191,38 +191,38 @@ func TestDeserialize(t *testing.T) { strictErr: "undeclared variable r0", }, { - input: `test$excessive_args2(r1)`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2(r1)`, + output: `test_excessive_args2(0x0)`, strictErr: "undeclared variable r1", }, { - input: `test$excessive_args2({0x0, 0x1})`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2({0x0, 0x1})`, + output: `test_excessive_args2(0x0)`, strictErr: "wrong struct arg", }, { - input: `test$excessive_args2([0x0], 0x0)`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2([0x0], 0x0)`, + output: `test_excessive_args2(0x0)`, strictErr: "wrong array arg", }, { - input: `test$excessive_args2(@foo)`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2(@foo)`, + output: `test_excessive_args2(0x0)`, strictErr: "wrong union arg", }, { - input: `test$excessive_args2('foo')`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2('foo')`, + output: `test_excessive_args2(0x0)`, strictErr: "wrong string arg", }, { - input: `test$excessive_args2(&(0x7f0000000000)={0x0, 0x1})`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2(&(0x7f0000000000)={0x0, 0x1})`, + output: `test_excessive_args2(0x0)`, strictErr: "wrong addr arg", }, { - input: `test$excessive_args2(nil)`, - output: `test$excessive_args2(0x0)`, + input: `test_excessive_args2(nil)`, + output: `test_excessive_args2(0x0)`, }, { input: `test$type_confusion1(&(0x7f0000000000)=@unknown)`, |
