Skip to content

Commit fbadcee

Browse files
committed
!ApplyTrapDI assertion
1 parent 3e53462 commit fbadcee

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,7 @@ CodeGenFunction::SanitizerScope::SanitizerScope(
27592759
assert(!CGF->IsSanitizerScope);
27602760
CGF->IsSanitizerScope = true;
27612761

2762+
assert(!this->ApplyTrapDI);
27622763
this->ApplyTrapDI =
27632764
new ApplyDebugLocation(*CGF, CGF->SanitizerAnnotateDebugInfo(Ordinals));
27642765
}
@@ -2767,6 +2768,7 @@ CodeGenFunction::SanitizerScope::~SanitizerScope() {
27672768
CGF->IsSanitizerScope = false;
27682769

27692770
delete ((ApplyDebugLocation *)this->ApplyTrapDI);
2771+
this->ApplyTrapDI = nullptr;
27702772
}
27712773

27722774
void CodeGenFunction::InsertHelper(llvm::Instruction *I,

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ class CodeGenFunction : public CodeGenTypeCache {
599599

600600
// ApplyDebugLocation is undeclared: CGDebugInfo.h is not #included in this
601601
// header due to overhead (b384d6d6ccc8f4452cd7086061c657ce76b41224)
602-
void *ApplyTrapDI;
602+
void *ApplyTrapDI = nullptr;
603603

604604
public:
605605
SanitizerScope(CodeGenFunction *CGF,

0 commit comments

Comments
 (0)