parent
ce98b43316
commit
5659c866f4
|
@ -2220,8 +2220,8 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName,
|
||||||
ArgTypes.push_back(IntPtrTy);
|
ArgTypes.push_back(IntPtrTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Recover = (RecoverKind == CRK_AlwaysRecoverable) ||
|
bool Recover = RecoverKind == CRK_AlwaysRecoverable ||
|
||||||
((RecoverKind == CRK_Recoverable) &&
|
(RecoverKind == CRK_Recoverable &&
|
||||||
CGM.getCodeGenOpts().SanitizeRecover);
|
CGM.getCodeGenOpts().SanitizeRecover);
|
||||||
|
|
||||||
llvm::FunctionType *FnType =
|
llvm::FunctionType *FnType =
|
||||||
|
@ -2234,15 +2234,14 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName,
|
||||||
B.addAttribute(llvm::Attribute::UWTable);
|
B.addAttribute(llvm::Attribute::UWTable);
|
||||||
|
|
||||||
// Checks that have two variants use a suffix to differentiate them
|
// Checks that have two variants use a suffix to differentiate them
|
||||||
bool NeedsAbortSuffix = (RecoverKind != CRK_Unrecoverable) &&
|
bool NeedsAbortSuffix = RecoverKind != CRK_Unrecoverable &&
|
||||||
!CGM.getCodeGenOpts().SanitizeRecover;
|
!CGM.getCodeGenOpts().SanitizeRecover;
|
||||||
std::string FunctionName = ("__ubsan_handle_" + CheckName +
|
std::string FunctionName = ("__ubsan_handle_" + CheckName +
|
||||||
(NeedsAbortSuffix? "_abort" : "")).str();
|
(NeedsAbortSuffix? "_abort" : "")).str();
|
||||||
llvm::Value *Fn =
|
llvm::Value *Fn = CGM.CreateRuntimeFunction(
|
||||||
CGM.CreateRuntimeFunction(FnType, FunctionName,
|
FnType, FunctionName,
|
||||||
llvm::AttributeSet::get(getLLVMContext(),
|
llvm::AttributeSet::get(getLLVMContext(),
|
||||||
llvm::AttributeSet::FunctionIndex,
|
llvm::AttributeSet::FunctionIndex, B));
|
||||||
B));
|
|
||||||
llvm::CallInst *HandlerCall = EmitNounwindRuntimeCall(Fn, Args);
|
llvm::CallInst *HandlerCall = EmitNounwindRuntimeCall(Fn, Args);
|
||||||
if (Recover) {
|
if (Recover) {
|
||||||
Builder.CreateBr(Cont);
|
Builder.CreateBr(Cont);
|
||||||
|
|
Loading…
Reference in New Issue