projects
/
platform
/
upstream
/
bcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0014b52
)
Test case for incomplete types
author
Paul Chaignon
<paul.chaignon@gmail.com>
Tue, 22 Aug 2017 21:00:08 +0000
(23:00 +0200)
committer
Brenden Blanco
<bblanco@gmail.com>
Wed, 23 Aug 2017 17:18:38 +0000
(10:18 -0700)
The bcc rewriter segfaults when it encounters an incomplete type
(missing declaration or declaration after use) in a map declaration.
tests/python/test_clang.py
patch
|
blob
|
history
diff --git
a/tests/python/test_clang.py
b/tests/python/test_clang.py
index
376a5dc
..
70ff1b8
100755
(executable)
--- a/
tests/python/test_clang.py
+++ b/
tests/python/test_clang.py
@@
-591,6
+591,16
@@
int foo(struct pt_regs *ctx) {
with self.assertRaises(Exception):
b = BPF(text=text)
+ def test_incomplete_type(self):
+ text = """
+BPF_HASH(drops, struct key_t);
+struct key_t {
+ u64 location;
+};
+"""
+ with self.assertRaises(Exception):
+ b = BPF(text=text)
+
if __name__ == "__main__":
main()