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.
@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.
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 inVirtualCallTargets::run()
and is used later inVirtualCallTargets::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 ofLookupDomTree
tostd::function
, which owns a callable object.[1] LLVM reference
Signed-off-by: Binrui Dong brett.browning.dong@gmail.com