-
Notifications
You must be signed in to change notification settings - Fork 15
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 handling of points-to flags for memcpy in Steensgaard #373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something, but isn't the flag copying one level too shallow? See comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code still accidentally applies flags from the addresses. I was wondering if target location unification doesn't automatically merge the flags of locations pointing to the unified locations?
If a->x and b->y, with b being marked as pointing to escaped/external and x and y get unified, will that operation automatically mark a as pointing to escaped/external?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within the current framework of flags, this makes sense. I'm still a bit unsure about what happens when locations don't know about pointing to escaped until propagation, when you have
s -> a -> u
d -> b -> u
And then a turns out to escape later due to s being returned or otherwise leaving the module. Then u also escapes due to propagation, but b is not marked as pointing to escaped. Does b however need to be marked as escaping, or is it enough to have one pointer to u being marked as PointingToEscaped?
I will overhaul this PR tomorrow. As written above, it currently is not properly working. |
@haved : I updated the memcpy analysis. Could you have a look at it again, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this seems like a safe fix for handling late propagation. It would be interesting to see if this would continue to be an issue if the flags were on the pointee location, and not on the pointing location, but such a redesign might introduce other issues I haven't thought about
Closes #334