about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorWaffle <waffle.lapkin@gmail.com>2021-03-04 11:30:48 +0300
committerWaffle <waffle.lapkin@gmail.com>2021-03-04 17:10:57 +0300
commit84e9608596f14eba78b8ff0371f747f7513b523a (patch)
tree1c4b21c9b4e724114d84d65b947147d7402b35ba /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentec7f258d543e1ac7d0b94435972331e85da8c509 (diff)
downloadrust-84e9608596f14eba78b8ff0371f747f7513b523a.tar.gz
rust-84e9608596f14eba78b8ff0371f747f7513b523a.zip
Fix leak in Vec::extend_from_within
Previously vec's len was updated only after full copy, making the method
leak if T::clone panic!s.

This commit makes `Vec::extend_from_within` (or, more accurately, it's
`T: Clone` specialization) update vec's len on every iteration, fixing
the issue.

`T: Copy` specialization was not affected by the issue b/c it doesn't
call user specified code (as, e.g. `T::clone`), and instead calls
`ptr::copy_nonoverlapping`.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions