r320982 - Revert r320978 "No -fsanitize=function warning when calling noexcept function through non-noexcept pointer in C++17"
Stephan Bergmann via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 18 05:51:48 PST 2017
Author: sberg
Date: Mon Dec 18 05:51:48 2017
New Revision: 320982
URL: http://llvm.org/viewvc/llvm-project?rev=320982&view=rev
Log:
Revert r320978 "No -fsanitize=function warning when calling noexcept function through non-noexcept pointer in C++17"
At least <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/
builds/6013/steps/annotate/logs/stdio> complains about
__ubsan::__ubsan_handle_function_type_mismatch_abort (compiler-rt
lib/ubsan/ubsan_handlers.cc) returning now despite being declared 'noreturn', so
looks like a different approach is needed for the function_type_mismatch check
to be called also in cases that may ultimately succeed.
Modified:
cfe/trunk/lib/CodeGen/CGExpr.cpp
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=320982&r1=320981&r2=320982&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Dec 18 05:51:48 2017
@@ -4504,14 +4504,10 @@ RValue CodeGenFunction::EmitCall(QualTyp
Builder.CreateICmpEQ(CalleeRTTI, FTRTTIConst);
llvm::Constant *StaticData[] = {
EmitCheckSourceLocation(E->getLocStart()),
- EmitCheckTypeDescriptor(CalleeType),
- cast<FunctionProtoType>(FnType)->isNothrow(getContext())
- ? llvm::Constant::getNullValue(FTRTTIConst->getType())
- : FTRTTIConst
+ EmitCheckTypeDescriptor(CalleeType)
};
EmitCheck(std::make_pair(CalleeRTTIMatch, SanitizerKind::Function),
- SanitizerHandler::FunctionTypeMismatch, StaticData,
- {CalleePtr, CalleeRTTI});
+ SanitizerHandler::FunctionTypeMismatch, StaticData, CalleePtr);
Builder.CreateBr(Cont);
EmitBlock(Cont);
More information about the cfe-commits
mailing list