diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
commit | 344a3780b2e33f6ca763666c380202b18aab72a3 (patch) | |
tree | f0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h | |
parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) | |
download | src-344a3780b2e33f6ca763666c380202b18aab72a3.tar.gz src-344a3780b2e33f6ca763666c380202b18aab72a3.zip |
Vendor import of llvm-project main 88e66fa60ae5, the last commit beforevendor/llvm-project/llvmorg-13-init-16847-g88e66fa60ae5vendor/llvm-project/llvmorg-12.0.1-rc2-0-ge7dac564cd0evendor/llvm-project/llvmorg-12.0.1-0-gfed41342a82f
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.h | 12 |
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; } |