[OpaquePtr][BitcodeReader] Explicitly turn off opaque pointers if we see a typed...
authorArthur Eubanks <aeubanks@google.com>
Tue, 17 May 2022 00:49:59 +0000 (17:49 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 17 May 2022 15:43:02 +0000 (08:43 -0700)
Followup to D125735 on the bitcode reader side.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D125736

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

index 901c117..9d49a96 100644 (file)
@@ -1890,6 +1890,8 @@ Error BitcodeReader::parseTypeTableBody() {
       if (!ResultTy ||
           !PointerType::isValidElementType(ResultTy))
         return error("Invalid type");
+      if (LLVM_UNLIKELY(!Context.hasSetOpaquePointersValue()))
+        Context.setOpaquePointers(false);
       ContainedIDs.push_back(Record[0]);
       ResultTy = PointerType::get(ResultTy, AddressSpace);
       break;