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) {
64806480llvm::DILocation *CodeGenFunction::SanitizerAnnotateDebugInfo (
64816481 ArrayRef<SanitizerKind::SanitizerOrdinal> Ordinals,
64826482 SanitizerHandler Handler) {
6483+ llvm::DILocation *CheckDebugLoc = Builder.getCurrentDebugLocation ();
6484+ auto *DI = getDebugInfo ();
6485+ if (!DI)
6486+ return CheckDebugLoc;
6487+
64836488 std::string Label;
64846489 if (Ordinals.size () == 1 )
64856490 Label = SanitizerOrdinalToCheckLabel (Ordinals[0 ]);
64866491 else
64876492 Label = SanitizerHandlerToCheckLabel (Handler);
64886493
6489- llvm::DILocation *CheckDI = Builder.getCurrentDebugLocation ();
6490-
64916494 for (auto Ord : Ordinals) {
64926495 // TODO: deprecate ClArrayBoundsPseudoFn
64936496 if (((ClArrayBoundsPseudoFn && Ord == SanitizerKind::SO_ArrayBounds) ||
64946497 CGM.getCodeGenOpts ().SanitizeAnnotateDebugInfo .has (Ord)) &&
6495- CheckDI ) {
6496- return getDebugInfo () ->CreateSyntheticInlineAt (CheckDI , Label);
6498+ CheckDebugLoc ) {
6499+ return DI ->CreateSyntheticInlineAt (CheckDebugLoc , Label);
64976500 }
64986501 }
64996502
6500- return CheckDI ;
6503+ return CheckDebugLoc ;
65016504}
65026505
65036506SanitizerDebugLocation::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