From a90e7c5042db33b4cc05625af4593e1a796533dc Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Mon, 9 Sep 2013 15:26:13 -0700 Subject: PNaCl bitcode: Make the reader reject TYPE_CODE_POINTER in the type table Making the reader stricter is something I forgot to do in my earlier change that stops the writer from emitting TYPE_CODE_POINTER. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671 TEST=test/NaCl/Bitcode/*.ll Review URL: https://codereview.chromium.org/23658027 --- lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp') diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp index c826ab3353..41acb6f999 100644 --- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp +++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp @@ -326,6 +326,10 @@ bool NaClBitcodeReader::ParseTypeTableBody() { break; case naclbitc::TYPE_CODE_POINTER: { // POINTER: [pointee type] or // [pointee type, address space] + // TODO(mseaborn): Remove this case when we drop support for v1 + // of the PNaCl bitcode format. + if (GetPNaClVersion() >= 2) + return Error("Pointer types not supported in PNaCl bitcode"); if (Record.size() < 1) return Error("Invalid POINTER type record"); unsigned AddressSpace = 0; -- cgit v1.2.3-18-g5258