summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-22 08:31:54 +0200
committerTyge Løvset <[email protected]>2021-09-22 08:31:54 +0200
commitbc09a3419e12d069a62c020027c7f1f598eb0c30 (patch)
treeafdd0695e0aa1991771e407cae86fc1b857fe30d /include
parent8bd303dc6558d4a5182321e639ae66af9fd742ab (diff)
downloadSTC-modified-bc09a3419e12d069a62c020027c7f1f598eb0c30.tar.gz
STC-modified-bc09a3419e12d069a62c020027c7f1f598eb0c30.zip
Fixed bug in csptr_copy on self assign.
Diffstat (limited to 'include')
-rw-r--r--include/stc/csptr.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/stc/csptr.h b/include/stc/csptr.h
index 11dfaa5a..b0857a25 100644
--- a/include/stc/csptr.h
+++ b/include/stc/csptr.h
@@ -157,12 +157,11 @@ cx_memb(_reset_make)(Self* self, cx_value_t val) {
return self->get;
}
-STC_INLINE cx_value_t*
+STC_INLINE void
cx_memb(_copy)(Self* self, Self ptr) {
+ if (ptr.use_count) cx_increment(ptr.use_count);
cx_memb(_del)(self);
*self = ptr;
- if (self->use_count) cx_increment(self->use_count);
- return self->get;
}
STC_INLINE int