diff options
| author | bors <bors@rust-lang.org> | 2016-11-06 23:05:58 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-06 23:05:58 -0800 |
| commit | 045a727b8362103052ae3c5f51ad24f069bbd43f (patch) | |
| tree | d35159895556b813f5f6b56db2240b8009f9de22 /src/test/run-pass/thinlto | |
| parent | 09fc1af9d80ecb71c82367b6569461e645a3a946 (diff) | |
| parent | 99aaccd32fe7b63366fa13b48f485fd1cdcd8660 (diff) | |
| download | rust-045a727b8362103052ae3c5f51ad24f069bbd43f.tar.gz rust-045a727b8362103052ae3c5f51ad24f069bbd43f.zip | |
Auto merge of #37605 - dsprenkels:arc-max-refcount, r=alexcrichton
Fix Arc::clone()'s MAX_REFCOUNT check (off-by-one) Before, the strong count of an `Arc` could be set to `MAX_REFCOUNT + 1`, because when this happened, `old_size` would be exactly `MAX_REFCOUNT`. `Arc::clone()` would not abort. This commit changes the check in `Arc::clone()` to also abort if the old value is equal to `MAX_REFCOUNT`, because then the new value will be equal to `MAX_REFCOUNT + 1`. A test would require allocating memory for `isize::MAX` pointers. This would probably crash any machine, so no test is submitted with this commit.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
