File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -6480,24 +6480,27 @@ SanitizerOrdinalToCheckLabel(SanitizerKind::SanitizerOrdinal Ordinal) {
6480
6480
llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo (
6481
6481
ArrayRef<SanitizerKind::SanitizerOrdinal> Ordinals,
6482
6482
SanitizerHandler Handler) {
6483
+ llvm::DILocation *CheckDebugLoc = Builder.getCurrentDebugLocation ();
6484
+ auto *DI = getDebugInfo ();
6485
+ if (!DI)
6486
+ return CheckDebugLoc;
6487
+
6483
6488
std::string Label;
6484
6489
if (Ordinals.size () == 1 )
6485
6490
Label = SanitizerOrdinalToCheckLabel (Ordinals[0 ]);
6486
6491
else
6487
6492
Label = SanitizerHandlerToCheckLabel (Handler);
6488
6493
6489
- llvm::DILocation *CheckDI = Builder.getCurrentDebugLocation ();
6490
-
6491
6494
for (auto Ord : Ordinals) {
6492
6495
// TODO: deprecate ClArrayBoundsPseudoFn
6493
6496
if (((ClArrayBoundsPseudoFn && Ord == SanitizerKind::SO_ArrayBounds) ||
6494
6497
CGM.getCodeGenOpts ().SanitizeAnnotateDebugInfo .has (Ord)) &&
6495
- CheckDI ) {
6496
- return getDebugInfo () ->CreateSyntheticInlineAt (CheckDI , Label);
6498
+ CheckDebugLoc ) {
6499
+ return DI ->CreateSyntheticInlineAt (CheckDebugLoc , Label);
6497
6500
}
6498
6501
}
6499
6502
6500
- return CheckDI ;
6503
+ return CheckDebugLoc ;
6501
6504
}
6502
6505
6503
6506
SanitizerDebugLocation::SanitizerDebugLocation (
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -g -fsanitize=null -fsanitize-trap=all -fsanitize-annotate-debug-info=all -O2 -std=c++17 -c -o /dev/null %s
2
+
3
+ struct foo {
4
+ foo (int , long , const int & = int ());
5
+ } foo(0 , 0 );
You can’t perform that action at this time.
0 commit comments