diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-07-30 18:28:51 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-07-31 00:30:17 +0300 |
commit | b72b5365afe319e576e254f12437aeff899eb03e (patch) | |
tree | 4274892785abd6c211d1c055a0c68d9900a7b448 /mesonbuild/ast/introspection.py | |
parent | 148a3a83a647a21cc102cb01d82cbeeb0940adc8 (diff) | |
download | meson-b72b5365afe319e576e254f12437aeff899eb03e.zip meson-b72b5365afe319e576e254f12437aeff899eb03e.tar.gz meson-b72b5365afe319e576e254f12437aeff899eb03e.tar.bz2 |
mintro: Fix crash related to the sources kwarg (fixes #5741)
Diffstat (limited to 'mesonbuild/ast/introspection.py')
-rw-r--r-- | mesonbuild/ast/introspection.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 617b140..aeb0400 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -158,16 +158,20 @@ class IntrospectionInterpreter(AstInterpreter): args = self.flatten_args(args) if not args or not isinstance(args[0], str): return - kwargs = self.flatten_kwargs(kwargs, True) name = args[0] srcqueue = [node] + + # Process the soruces BEFORE flattening the kwargs, to preserve the original nodes if 'sources' in kwargs: - srcqueue += kwargs['sources'] + srcqueue += mesonlib.listify(kwargs['sources']) + + kwargs = self.flatten_kwargs(kwargs, True) source_nodes = [] while srcqueue: curr = srcqueue.pop(0) arg_node = None + assert(isinstance(curr, BaseNode)) if isinstance(curr, FunctionNode): arg_node = curr.args elif isinstance(curr, ArrayNode): |