From c04651fe241ebaa4a32e49590416b0bbabebc5fa Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Sat, 13 Apr 2019 09:20:47 +0200 Subject: [PATCH] mintro: Fix set_variable plus assign bug (closes #5256) --- mesonbuild/ast/interpreter.py | 1 + test cases/unit/55 introspection/meson.build | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py index f1602c0f3..a82ba5d63 100644 --- a/mesonbuild/ast/interpreter.py +++ b/mesonbuild/ast/interpreter.py @@ -171,6 +171,7 @@ class AstInterpreter(interpreterbase.InterpreterBase): assert(isinstance(node, mparser.PlusAssignmentNode)) if node.var_name not in self.assignments: self.assignments[node.var_name] = [] + self.assign_vals[node.var_name] = [] self.assignments[node.var_name] += [node.value] # Save a reference to the value node if hasattr(node.value, 'ast_id'): self.reverse_assignment[node.value.ast_id] = node diff --git a/test cases/unit/55 introspection/meson.build b/test cases/unit/55 introspection/meson.build index 588f71cd7..95a7c5f0f 100644 --- a/test cases/unit/55 introspection/meson.build +++ b/test cases/unit/55 introspection/meson.build @@ -9,6 +9,9 @@ b2 = get_option('test_opt2') test_bool = b1 or b2 test_bool = b1 and b2 +set_variable('list_test_plusassign', []) +list_test_plusassign += ['bugs everywhere'] + if false dependency('somethingthatdoesnotexist', required: true) dependency('look_i_have_a_fallback', fallback: ['oh_no', 'the_subproject_does_not_exist'])