aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Compression.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2020-05-03 14:52:19 +0200
committerBenjamin Kramer <benny.kra@googlemail.com>2020-05-03 15:01:52 +0200
commit7a529ad2c142eb77ff1140e166fb85242d4cf05f (patch)
tree79d70005c96230001bffe442f61dac10314e0610 /llvm/lib/Support/Compression.cpp
parent7c203163c7b5869549244206b9be040f09fb6c05 (diff)
downloadllvm-7a529ad2c142eb77ff1140e166fb85242d4cf05f.zip
llvm-7a529ad2c142eb77ff1140e166fb85242d4cf05f.tar.gz
llvm-7a529ad2c142eb77ff1140e166fb85242d4cf05f.tar.bz2
[Support] Don't initialize buffer allocated by zlib::uncompress
This is a somewhat annoying API, but not without precedend in this low level API.
Diffstat (limited to 'llvm/lib/Support/Compression.cpp')
-rw-r--r--llvm/lib/Support/Compression.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Compression.cpp b/llvm/lib/Support/Compression.cpp
index 97d5ffa..27d92f0 100644
--- a/llvm/lib/Support/Compression.cpp
+++ b/llvm/lib/Support/Compression.cpp
@@ -74,10 +74,10 @@ Error zlib::uncompress(StringRef InputBuffer, char *UncompressedBuffer,
Error zlib::uncompress(StringRef InputBuffer,
SmallVectorImpl<char> &UncompressedBuffer,
size_t UncompressedSize) {
- UncompressedBuffer.resize(UncompressedSize);
+ UncompressedBuffer.reserve(UncompressedSize);
Error E =
uncompress(InputBuffer, UncompressedBuffer.data(), UncompressedSize);
- UncompressedBuffer.resize(UncompressedSize);
+ UncompressedBuffer.set_size(UncompressedSize);
return E;
}