diff options
Diffstat (limited to 'mesonbuild/ast')
-rw-r--r-- | mesonbuild/ast/interpreter.py | 10 | ||||
-rw-r--r-- | mesonbuild/ast/introspection.py | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py index eb9cb9f..5354710 100644 --- a/mesonbuild/ast/interpreter.py +++ b/mesonbuild/ast/interpreter.py @@ -260,6 +260,12 @@ class AstInterpreter(interpreterbase.InterpreterBase): id_loop_detect = [] flattend_args = [] + if isinstance(args, BaseNode): + assert(hasattr(args, 'ast_id')) + if args.ast_id in id_loop_detect: + return [] # Loop detected + id_loop_detect += [args.ast_id] + if isinstance(args, ArrayNode): args = [x for x in args.args.arguments] @@ -301,8 +307,8 @@ class AstInterpreter(interpreterbase.InterpreterBase): # Resolve the contents of args for i in args: - if isinstance(i, IdNode) and i.value not in id_loop_detect: - flattend_args += self.flatten_args(quick_resolve(i), include_unknown_args, id_loop_detect + [i.value]) + if isinstance(i, IdNode): + flattend_args += self.flatten_args(quick_resolve(i), include_unknown_args, id_loop_detect) elif isinstance(i, (ArrayNode, ArgumentNode, ArithmeticNode, MethodNode)): flattend_args += self.flatten_args(i, include_unknown_args, id_loop_detect) elif isinstance(i, mparser.ElementaryNode): diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index b6ec450..5ac6133 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -118,7 +118,7 @@ class IntrospectionInterpreter(AstInterpreter): subproject_dir_abs = os.path.join(self.environment.get_source_dir(), self.subproject_dir) subpr = os.path.join(subproject_dir_abs, dirname) try: - subi = IntrospectionInterpreter(subpr, '', self.backend, cross_file=self.cross_file, subproject=dirname, subproject_dir=self.subproject_dir, env=self.environment) + subi = IntrospectionInterpreter(subpr, '', self.backend, cross_file=self.cross_file, subproject=dirname, subproject_dir=self.subproject_dir, env=self.environment, visitors=self.visitors) subi.analyze() subi.project_data['name'] = dirname self.project_data['subprojects'] += [subi.project_data] |