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

Support for GEP in init values & pointer subtraction in alias analysis #568

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

ThomasHaas
Copy link
Collaborator

This PR fixes the following two problems.

(1) #567 added support for parsing GEPs in initializers of globals, however, our GEPToAddition didn't lower those GEPs to additions which caused exceptions during encoding (cause GEPs were not encodable).

(2) When dealing with code that uses container_of-magic, the IR ends up having pointer subtractions (e.g. ptr - 12).
Our alias analysis wrongly handled those (it was not just imprecise but also incorrect!).
I added handling for subtraction. @xeren Can you check that my simple fix makes sense?

Support subtraction in AliasAnalysis
@ThomasHaas ThomasHaas requested a review from xeren November 13, 2023 16:47
Copy link
Collaborator

@xeren xeren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hernanponcedeleon hernanponcedeleon merged commit c93efdc into development Nov 14, 2023
1 check passed
@hernanponcedeleon hernanponcedeleon deleted the gep_in_init&alias_sub branch November 14, 2023 21:32
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.

3 participants