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

Fix conflicting varannot #220

Closed
wants to merge 2 commits into from

Conversation

baoruiz
Copy link
Member

@baoruiz baoruiz commented Apr 25, 2019

Currently CFI does not properly handle it when adding variable annotations. Notice that VarAnnot and real annotations are treated differently by InferenceQualifierHierarchy#findAnnotationInSameHierarchy and InferenceQualifierHierarchy#findAnnotationInHierarchy, while considered to be in the same qualifier hierarchy.

In this case, calling replaceAnnotation (which uses findAnnotationInSameHierarchy to fetch and remove existing annotations of the same hierarchy) attempting to replace a real annotation with a variable annotation does not work as intended, and it will add the variable annotation with the original annotation left intact, resulting in conflicting annotations.

This pull request is currently only a partial fix and serves as an example of such issues, as there are other places where similar issues are expected to arise, given our experience experimenting on PICO inference. Whenever CFI crashes with a "conflicting annotations" exception between real annotations and variable annotations (or between variable annotations and variable annotations) being raised, it is possible to be a similar problem to the ones illustrated here.

CFI master currently does not have such problems because conflicting annotations check is temporarily disabled (among others), but customized checkers like GUT and PICO could suffer from it.

@wmdietl
Copy link
Member

wmdietl commented May 28, 2020

@txiang61 I think you were running into similar problems. Could you finish up this PR?

@txiang61
Copy link
Member

Fix included in #262

@txiang61 txiang61 closed this May 28, 2020
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