From 470910c4ad8af2555c49aec16409630d2a3246b6 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Mon, 16 May 2022 17:49:59 -0700 Subject: [PATCH] [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 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 901c117..9d49a96 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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; -- 2.7.4