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

analyze: allow pointee analysis to work interprocedurally #1172

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

spernsteiner
Copy link
Collaborator

This branch modifies the pointee-type analysis to use a single global VarTable for all functions, which allows pointee inference variables produced in one function to be resolved in another. This is necessary for lighttpd's buffer module, which allocates a buffer object in one function (producing an inference variable for the malloc) and initializes it in a different function (where the inference variable can now be resolved).

The pointee analysis previously involved an "export" operation that ran after processing each function to convert the analysis results to a form that makes sense in other functions. This meant that the results couldn't contain any inference variables or mention any local PointerIds. Any entries in the results that violated these constraints would be erased, and the result set would be marked "incomplete". With this branch, both constraints are lifted, as both inference variables and local PointerIds are representable in the global scope.

@spernsteiner spernsteiner requested a review from ahomescu December 2, 2024 18:32
@spernsteiner spernsteiner force-pushed the analyze-pointee-interprocedural branch from 689453a to 839f0e5 Compare December 2, 2024 19:43
@spernsteiner spernsteiner force-pushed the analyze-pointee-interprocedural-base branch from 4e95089 to ee4b3cc Compare December 2, 2024 19:43
@spernsteiner spernsteiner changed the base branch from analyze-pointee-interprocedural-base to master December 2, 2024 22:23
c2rust-analyze/src/analyze.rs Outdated Show resolved Hide resolved
@spernsteiner spernsteiner merged commit a0850b1 into master Dec 3, 2024
9 checks passed
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