summaryrefslogtreecommitdiff
path: root/test cases/unit
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2025-06-02 18:04:50 +0200
committerJussi Pakkanen <jussi.pakkanen@mailbox.org>2025-06-09 21:01:09 +0300
commit4a57a5fd0cdd5064a03566f40b61c827f27ea529 (patch)
tree575074ebb07a3d786787e62c328c121653e53433 /test cases/unit
parenta3f43cbc5b3738bd26f421d00c1b53736364954c (diff)
downloadmeson-4a57a5fd0cdd5064a03566f40b61c827f27ea529.tar.gz
AstInterpreter: Fix dead-code-crash
Without this commit, the rewriter and the static introspection tool crash if `meson.build` contains something like ```meson if false foo = not_defined endif ``` or ```meson if false message(not_defined) endif ``` While it could be argued, that you should not write stuff like this, this used to raise a `MesonBugException`, which we have to fix. Fixes #14667
Diffstat (limited to 'test cases/unit')
-rw-r--r--test cases/unit/120 rewrite/meson.build6
1 files changed, 6 insertions, 0 deletions
diff --git a/test cases/unit/120 rewrite/meson.build b/test cases/unit/120 rewrite/meson.build
index 545bb0fde..654b09d16 100644
--- a/test cases/unit/120 rewrite/meson.build
+++ b/test cases/unit/120 rewrite/meson.build
@@ -190,5 +190,11 @@ if a \
debug('help!')
endif
+if false
+ # Should produce a warning, but should not crash
+ foo = not_defined
+ message(not_defined)
+endif
+
# End of file comment with no linebreak \ No newline at end of file