Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/atom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@
fn clone(&self) -> Self {
if self.tag() == DYNAMIC_TAG {
let entry = self.unsafe_data.get() as *const Entry;
unsafe { &*entry }.ref_count.fetch_add(1, SeqCst);
// SAFETY: `self` is a valid Atom, meaning its `unsafe_data` points to a live `Entry`
// kept alive by `self`'s reference count. We can safely dereference it.
if unsafe { &*entry }.ref_count.fetch_add(1, SeqCst) == std::isize::MAX {

Check failure on line 253 in src/atom.rs

View workflow job for this annotation

GitHub Actions / Build and Test (beta)

use of deprecated constant `std::isize::MAX`: replaced by the `MAX` associated constant on this type

Check warning on line 253 in src/atom.rs

View workflow job for this annotation

GitHub Actions / Build and Test (beta)

use of deprecated constant `std::isize::MAX`: replaced by the `MAX` associated constant on this type
std::process::abort();
}
}
Atom { ..*self }
}
Expand Down
Loading