Skip to content

Commit 758043f

Browse files
committed
fix(visitor): skip lambda function definitions
1 parent 3dc43f9 commit 758043f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/dwarf2cpp/visitor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ def visit_subprogram(self, die: DWARFDie) -> None:
397397
printer.append_unqualified_name(spec)
398398
name = str(printer)
399399

400+
function_name = name.split("<", maxsplit=1)[0]
401+
if function_name.endswith("class ::operator()"):
402+
# lambda function definitions - skip them
403+
return
404+
400405
function = Function(name=name, returns=declaration.returns, is_const=declaration.is_const)
401406
else:
402407
if die.find("DW_AT_artificial") is not None:

0 commit comments

Comments
 (0)