diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-09-15 08:26:45 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-09-15 08:40:10 +0200 |
| commit | a2360d0742f01e40bf4fb1714de4503f8a82aa3f (patch) | |
| tree | d19f7a0ea5283ace73add853922b595d44030a6c /executor/style_test.go | |
| parent | 6c16e36a7bc8ca1fa66de37e6e70003e0f14e2e8 (diff) | |
executor: fix definition of __NR_io_uring_setup
Sone syzbot instances broke with:
<stdin>: In function ‘syz_io_uring_setup’:
<stdin>:476:33: error: ‘__NR_io_uring_setup’ undeclared (first use in this function)
<stdin>:476:33: note: each undeclared identifier is reported only once for each function it appears in
pkg/csource resolves #ifdef's at generation time.
Diffstat (limited to 'executor/style_test.go')
| -rw-r--r-- | executor/style_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/executor/style_test.go b/executor/style_test.go index 488752626..f6f5856f3 100644 --- a/executor/style_test.go +++ b/executor/style_test.go @@ -44,6 +44,24 @@ if (foo) }, }, { + pattern: `#define __NR_`, + message: "Don't define syscall __NR_foo constants.\n" + + "These should be guarded by #ifndef __NR_foo, but this is dependent on the host " + + "and may break on other machines (after pkg/csource processing).\n" + + "Define sys_foo constants instead.", + tests: []string{ + ` +#ifndef __NR_io_uring_setup +#ifdef __alpha__ +#define __NR_io_uring_setup 535 +#else // !__alpha__ +#define __NR_io_uring_setup 425 +#endif +#endif // __NR_io_uring_setup +`, + }, + }, + { pattern: `//[^\s]`, suppression: `https?://`, message: "Add a space after //", |
