about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-11-06 23:05:58 -0800
committerGitHub <noreply@github.com>2016-11-06 23:05:58 -0800
commit045a727b8362103052ae3c5f51ad24f069bbd43f (patch)
treed35159895556b813f5f6b56db2240b8009f9de22 /src/test/run-pass/thinlto
parent09fc1af9d80ecb71c82367b6569461e645a3a946 (diff)
parent99aaccd32fe7b63366fa13b48f485fd1cdcd8660 (diff)
downloadrust-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