mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[asan] when checking the noreturn attribute on the call, also check it on the callee
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168861 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -845,6 +845,14 @@ bool AddressSanitizer::maybeInsertAsanInitAtFunctionEntry(Function &F) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check both the call and the callee for doesNotReturn().
|
||||
static bool isNoReturnCall(CallInst *CI) {
|
||||
if (CI->doesNotReturn()) return true;
|
||||
Function *F = CI->getCalledFunction();
|
||||
if (F && F->doesNotReturn()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AddressSanitizer::runOnFunction(Function &F) {
|
||||
if (BL->isIn(F)) return false;
|
||||
if (&F == AsanCtorFunction) return false;
|
||||
@@ -885,7 +893,7 @@ bool AddressSanitizer::runOnFunction(Function &F) {
|
||||
if (CallInst *CI = dyn_cast<CallInst>(BI)) {
|
||||
// A call inside BB.
|
||||
TempsToInstrument.clear();
|
||||
if (CI->doesNotReturn()) {
|
||||
if (isNoReturnCall(CI)) {
|
||||
NoReturnCalls.push_back(CI);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user