aboutsummaryrefslogtreecommitdiff
path: root/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-07-29 20:15:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-07-29 20:15:26 +0000
commit344a3780b2e33f6ca763666c380202b18aab72a3 (patch)
treef0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
parentb60736ec1405bb0a8dd40989f67ef4c93da068ab (diff)
downloadsrc-344a3780b2e33f6ca763666c380202b18aab72a3.tar.gz
src-344a3780b2e33f6ca763666c380202b18aab72a3.zip
the upstream release/13.x branch was created.
Diffstat (limited to 'llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h')
-rw-r--r--llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
index c9fadd727e88..63abb196ba49 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
@@ -62,8 +62,10 @@ public:
}
SymbolStringPtr& operator=(const SymbolStringPtr &Other) {
- if (isRealPoolEntry(S))
+ if (isRealPoolEntry(S)) {
+ assert(S->getValue() && "Releasing SymbolStringPtr with zero ref count");
--S->getValue();
+ }
S = Other.S;
if (isRealPoolEntry(S))
++S->getValue();
@@ -75,16 +77,20 @@ public:
}
SymbolStringPtr& operator=(SymbolStringPtr &&Other) {
- if (isRealPoolEntry(S))
+ if (isRealPoolEntry(S)) {
+ assert(S->getValue() && "Releasing SymbolStringPtr with zero ref count");
--S->getValue();
+ }
S = nullptr;
std::swap(S, Other.S);
return *this;
}
~SymbolStringPtr() {
- if (isRealPoolEntry(S))
+ if (isRealPoolEntry(S)) {
+ assert(S->getValue() && "Releasing SymbolStringPtr with zero ref count");
--S->getValue();
+ }
}
explicit operator bool() const { return S; }