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

crix-callgraph: fix a use-after-scope memory error in VirtualCallTargets.cpp #72

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

Conversation

BrettDong
Copy link

llvm::function_ref stores a reference but does not own a callable object [1]. LookupDomTree of that type is assigned to a local lambda object in VirtualCallTargets::run() and is used later in VirtualCallTargets::scanTypeTestUsers(), but the local lambda object is already out of scope at that time, and crashes the program on my computer. This pull request changes the type of LookupDomTree to std::function, which owns a callable object.

[1] LLVM reference


Signed-off-by: Binrui Dong [email protected]

@pahmann
Copy link
Contributor

pahmann commented Dec 14, 2022

@bulwahn do you agree to the fix. After merging the latest issue found by @henrirosten we can see that we rebase this PR in a way that the Travis CI will pass again.

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