Skip to content

Commit a227fdc

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
1 parent 0b8ea08 commit a227fdc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ static Value *getBoundsCheckCond(Value *Ptr, Value *InstVal,
108108
static CallInst *InsertTrap(BuilderTy &IRB) {
109109
if (!DebugTrapBB)
110110
return IRB.CreateIntrinsic(Intrinsic::trap, {}, {});
111+
// FIXME: Ideally we would use the SanitizerHandler::OutOfBounds constant.
111112
return IRB.CreateIntrinsic(
112113
Intrinsic::ubsantrap, {},
113114
ConstantInt::get(IRB.getInt8Ty(),
@@ -255,8 +256,10 @@ static bool addBoundsChecking(Function &F, TargetLibraryInfo &TLI,
255256
CallInst *TrapCall = Opts.UseTrap
256257
? InsertTrap(IRB)
257258
: InsertCall(IRB, Opts.MayReturn, Opts.Name);
258-
// Ideally we would use the SanitizerHandler::OutOfBounds constant
259+
if (DebugTrapBB) {
260+
// FIXME: Pass option form clang.
259261
TrapCall->addFnAttr(llvm::Attribute::NoMerge);
262+
}
260263

261264
TrapCall->setDoesNotThrow();
262265
TrapCall->setDebugLoc(DebugLoc);

0 commit comments

Comments
 (0)