[llvm] edf4780 - [BitcodeReader] Fix use-after-move

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 10:54:41 PST 2022


Author: Fangrui Song
Date: 2022-02-14T10:54:37-08:00
New Revision: edf4780ad125903dafbf2d87b03c26aa065cd210

URL: https://github.com/llvm/llvm-project/commit/edf4780ad125903dafbf2d87b03c26aa065cd210
DIFF: https://github.com/llvm/llvm-project/commit/edf4780ad125903dafbf2d87b03c26aa065cd210.diff

LOG: [BitcodeReader] Fix use-after-move

Added: 
    

Modified: 
    llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 5f6d980708a56..fa57edbc55275 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -831,7 +831,7 @@ BitcodeReader::BitcodeReader(BitstreamCursor Stream, StringRef Strtab,
                              StringRef ProducerIdentification,
                              LLVMContext &Context)
     : BitcodeReaderBase(std::move(Stream), Strtab), Context(Context),
-      ValueList(Context, Stream.SizeInBytes()) {
+      ValueList(Context, this->Stream.SizeInBytes()) {
   this->ProducerIdentification = std::string(ProducerIdentification);
 }
 


        


More information about the llvm-commits mailing list