diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-03-17 17:13:26 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-03-17 21:19:13 +0100 |
| commit | 97bc55cead011ec5d60af8c3696ee2724b78fea5 (patch) | |
| tree | e59b94f9ea8d5631fdc1c3e16f5cb60b5b84cb33 /pkg/compiler/testdata | |
| parent | 61e9cc09afc5bf1afdd993a6863ba063b07f0bb2 (diff) | |
pkg/compiler: check that flags values fit into base type
flags[foo, int8]
foo = 0x12345678
is always an error, detect these cases.
Found some bugs in mptcp, packet sockets, kvm.
Diffstat (limited to 'pkg/compiler/testdata')
| -rw-r--r-- | pkg/compiler/testdata/errors2.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index 4ec52d6cb..b862c4951 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -274,6 +274,9 @@ foo$530(a ptr[in, const[0x1ab, int8]]) ### const val 0x1ab does not fit into 8 b foo$531(a ptr[in, const[0xffffffffffffffab, int8]]) foo$532(a ptr[in, const[0x7234567812345678, int64]]) foo$533(a ptr[in, const[0x12, int8:4]]) ### const val 0x12 does not fit into 4 bits +foo$534(a ptr[in, flags[large_flags, int8]]) ### large_flags U16_MAX=0xffff doesn't fit into 8 bits + +large_flags = U8_MAX, U16_MAX type type500 proc[C1, 8, int8] ### values starting from 1 with step 8 overflow base type for 32 procs type type501 int8 ### unused type type501 |
