summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Attributes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Attributes.cpp b/llvm/lib/VMCore/Attributes.cpp
index c9240e534c7..37a217fc8c5 100644
--- a/llvm/lib/VMCore/Attributes.cpp
+++ b/llvm/lib/VMCore/Attributes.cpp
@@ -131,8 +131,8 @@ public:
}
void DropRef() {
sys::SmartScopedLock<true> Lock(*ALMutex);
- sys::cas_flag old = RefCount++;
- if (old == 1)
+ sys::cas_flag new_val = RefCount--;
+ if (new_val == 0)
delete this;
}
OpenPOWER on IntegriCloud