diff options
author | Eric Liu <ioeric@google.com> | 2019-01-31 14:20:02 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2019-01-31 14:20:02 +0000 |
commit | a22c72ca8ff55a70e38ea0d40929a48324e5b8a4 (patch) | |
tree | 150d60d525f4ad0395c2a226c3207b700219c2e9 /clang/lib/CodeGen/CGCall.cpp | |
parent | 0ca744c8454de17a9907d1b3430d1a1b9f315bd8 (diff) | |
download | bcm5719-llvm-a22c72ca8ff55a70e38ea0d40929a48324e5b8a4.tar.gz bcm5719-llvm-a22c72ca8ff55a70e38ea0d40929a48324e5b8a4.zip |
Revert "[Sanitizers] UBSan unreachable incompatible with ASan in the presence of `noreturn` calls"
This reverts commit r352690. This causes clang to crash. Sent reproducer to the
author in the orginal commit.
llvm-svn: 352755
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 655c75c01f6..893a6f2f902 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -4398,23 +4398,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, // Strip away the noreturn attribute to better diagnose unreachable UB. if (SanOpts.has(SanitizerKind::Unreachable)) { - // Also remove from function since CI->hasFnAttr(..) also checks attributes - // of the called function. if (auto *F = CI->getCalledFunction()) F->removeFnAttr(llvm::Attribute::NoReturn); CI->removeAttribute(llvm::AttributeList::FunctionIndex, llvm::Attribute::NoReturn); - - // Avoid incompatibility with ASan which relies on the `noreturn` - // attribute to insert handler calls. - if (SanOpts.has(SanitizerKind::Address)) { - SanitizerScope SanScope(this); - Builder.SetInsertPoint(CI); - auto *FnType = llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false); - auto *Fn = CGM.CreateRuntimeFunction(FnType, "__asan_handle_no_return"); - EmitNounwindRuntimeCall(Fn); - Builder.SetInsertPoint(CI->getParent()); - } } EmitUnreachable(Loc); |