Commit 574c3ebc authored by Paul Chaignon's avatar Paul Chaignon Committed by Brenden Blanco

Test case for incomplete types

The bcc rewriter segfaults when it encounters an incomplete type
(missing declaration or declaration after use) in a map declaration.
parent 0014b523
......@@ -587,6 +587,16 @@ int bar(void) {
int foo(struct pt_regs *ctx) {
return bar();
}
"""
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment