Skip to content

AstInterpreter: Fix crash when dead code references variables that are never assigned #14671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Volker-Weissmann
Copy link
Contributor

Without this PR, the rewriter and the static introspection tool crash if meson.build contains something like

if false
  foo = not_defined
endif

or

if false
  message(not_defined)
endif

While it could be argued, that you should not write stuff like this, it raises a MesonBugException without this PR, which we have to fix.

Fixes #14667

@Volker-Weissmann
Copy link
Contributor Author

@bonzini @bruchar1 @dcbaker
Maybe you are interested in this

@Volker-Weissmann Volker-Weissmann marked this pull request as draft June 2, 2025 17:09
@jpakkane
Copy link
Member

jpakkane commented Jun 3, 2025

Test failure seems relevant.

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 mesonbuild#14667
@Volker-Weissmann
Copy link
Contributor Author

Test failure seems relevant.

Fixed

@Volker-Weissmann Volker-Weissmann marked this pull request as ready for review June 4, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

meson introspect breaks on QEMU (node.ast_id assert in resolve_node fires)
3 participants