diff options
| author | Mark Simulacrum <mark.simulacrum@gmail.com> | 2016-12-23 20:47:47 -0700 |
|---|---|---|
| committer | Mark Simulacrum <mark.simulacrum@gmail.com> | 2016-12-31 08:38:56 -0700 |
| commit | bb1959f4167f174404dc04808e07138dfd1a735b (patch) | |
| tree | fa1cc96db8cfd1a1785298f93ca4ab36058e8fb7 /src | |
| parent | 9e963b9b2f7da465e66b733403b726b89304d976 (diff) | |
| download | rust-bb1959f4167f174404dc04808e07138dfd1a735b.tar.gz rust-bb1959f4167f174404dc04808e07138dfd1a735b.zip | |
Fix TypedArena infinitely looping when inplace reallocation fails.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libarena/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs index 02e548c4f6e..cde8a85d97c 100644 --- a/src/libarena/lib.rs +++ b/src/libarena/lib.rs @@ -196,9 +196,9 @@ impl<T> TypedArena<T> { self.end.set(last_chunk.end()); return; } else { - let prev_capacity = last_chunk.storage.cap(); + new_capacity = last_chunk.storage.cap(); loop { - new_capacity = prev_capacity.checked_mul(2).unwrap(); + new_capacity = new_capacity.checked_mul(2).unwrap(); if new_capacity >= currently_used_cap + n { break; } |
