Skip to content

Conversation

dberlin
Copy link
Contributor

@dberlin dberlin commented Mar 6, 2023

ASTExporter attempts to convert constant int expressions to actual int values through evaluation.

However, even when evaluation fails, it still attempts to convert the result into an APint, leading to an assertion in APInt (due to trying to convert a none value to APInt).

Fixed by respecting the result of evaluation and exiting if it says no evaluated value was produced.

@dberlin dberlin changed the title Don't attempt to evaluate constant values that don't exist Don't attempt to convert failed constant int evaluations into APint Mar 6, 2023
@fw-immunant
Copy link
Contributor

Hi, thanks for the PR! Could you provide a test case that triggers the behavior you're describing?

If it's too much trouble to navigate the project's testing infrastructure to add a test case, feel free to just post some code and I'll integrate it into our tests.

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.

2 participants