Commit 7aaa12f1 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1563 from iovisor/yhs_dev

fix map a type parsing issue for export/extern types
parents fd69c330 96354c67
......@@ -778,7 +778,8 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) {
return false;
}
fe_.table_storage().VisitMapType(table, C, key_type, leaf_type);
if (!table.is_extern)
fe_.table_storage().VisitMapType(table, C, key_type, leaf_type);
fe_.table_storage().Insert(local_path, move(table));
} else if (const PointerType *P = Decl->getType()->getAs<PointerType>()) {
// if var is a pointer to a packet type, clone the annotation into the var
......
......@@ -400,6 +400,7 @@ BPF_ARRAY(t3, union emptyu, 1);
def test_exported_maps(self):
b1 = BPF(text="""BPF_TABLE_PUBLIC("hash", int, int, table1, 10);""")
b2 = BPF(text="""BPF_TABLE("extern", int, int, table1, 10);""")
t = b2["table1"]
def test_syntax_error(self):
with self.assertRaises(Exception):
......
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