aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Stmt.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index b86717728c..53f0186671 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -174,6 +174,7 @@ public:
/// \brief Destroy the current statement and its children.
void Destroy(ASTContext &Ctx) {
+ assert(RefCount >= 0);
if (--RefCount == 0)
DoDestroy(Ctx);
}
@@ -183,6 +184,7 @@ public:
/// Invoke the Retain() operation when this statement or expression
/// is being shared by another owner.
Stmt *Retain() {
+ assert(RefCount >= 1);
++RefCount;
return this;
}