diff options
| author | Will Woods <w@wizard.zone> | 2025-02-28 17:36:19 -0800 |
|---|---|---|
| committer | Will Woods <w@wizard.zone> | 2025-02-28 17:36:19 -0800 |
| commit | 6d07144613ffb54e6856bd5543acfe5e12eb3447 (patch) | |
| tree | 19876838e85b83dedb8639dde8577728cf627796 /compiler/rustc_codegen_llvm/src | |
| parent | b1196717fcba13d8ff73ec06c3d8c5bee3b74ec9 (diff) | |
| download | rust-6d07144613ffb54e6856bd5543acfe5e12eb3447.tar.gz rust-6d07144613ffb54e6856bd5543acfe5e12eb3447.zip | |
Fix logic error in Buffer::read_more()
Buffer::read_more() is supposed to refill the buffer without discarding its contents, which are in the range `pos .. filled`. It mistakenly borrows the range `pos ..`, fills that, and then increments `filled` by the amount read. This overwrites the buffer's existing contents and sets `filled` to a too-large value that either exposes uninitialized bytes or walks off the end of the buffer entirely. This patch makes it correctly fill only the unfilled portion of the buffer, which should maintain all the type invariants and fix the test failure introduced in commit b1196717fcb.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
