Skip to content
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

Don't attempt to convert failed constant int evaluations into APint #858

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

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