[OpaquePtr][BitcodeReader] Explicitly turn off opaque pointers if we see a typed pointer

Followup to D125735 on the bitcode reader side.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D125736
This commit is contained in:
Arthur Eubanks
2022-05-16 17:49:59 -07:00
parent d2be4f9549
commit 470910c4ad

View 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;