From 71a1930430a2e88d3ac0a22eb2bcbcc7940e69f4 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Fri, 15 Feb 2019 06:40:34 -0800 Subject: Protect visiting recursion against empty argument lists Fixes #308 --- examples/func_calls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/func_calls.py b/examples/func_calls.py index 84e8c27..97a7271 100644 --- a/examples/func_calls.py +++ b/examples/func_calls.py @@ -26,7 +26,8 @@ class FuncCallVisitor(c_ast.NodeVisitor): if node.name.name == self.funcname: print('%s called at %s' % (self.funcname, node.name.coord)) # Visit args in case they contain more func calls. - self.visit(node.args) + if node.args: + self.visit(node.args) def show_func_calls(filename, funcname): -- cgit v1.2.1