diff options
| author | Tyge Løvset <[email protected]> | 2022-05-02 13:06:31 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-05-02 13:06:31 +0200 |
| commit | 00b63b1930300ddb1e40f3f16315c8d58c31543b (patch) | |
| tree | 6248c81c7af89aedec38ba9c2a8b97e9f67fc978 | |
| parent | 14d7862488113da31ca2b918dc9f0904b2e65785 (diff) | |
| download | STC-modified-00b63b1930300ddb1e40f3f16315c8d58c31543b.tar.gz STC-modified-00b63b1930300ddb1e40f3f16315c8d58c31543b.zip | |
Fixed undefined behaviour (but working) code in carc.
| -rw-r--r-- | include/stc/carc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stc/carc.h b/include/stc/carc.h index 031c4f56..245ba708 100644 --- a/include/stc/carc.h +++ b/include/stc/carc.h @@ -130,7 +130,7 @@ STC_INLINE void _cx_memb(_drop)(_cx_self* self) {
if (self->use_count && _i_atomic_dec_and_test(self->use_count)) {
i_keydrop(self->get);
- if (self->get != &((_cx_carc_rep *)self->use_count)->value)
+ if ((char *)self->get != (char *)self->use_count + offsetof(_cx_carc_rep, value))
c_free(self->get);
c_free(self->use_count);
}
|
