llvm.org GIT mirror llvm / 27ca64f
Change a reachable unreachable to a fatal error. Summary: Also tagged a FIXME comment, and added information about why it breaks. Bug found using AFL fuzz. Reviewers: rafael, craig.topper Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9729 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237709 91177308-0d34-0410-b5e6-96231b3b80d8 Filipe Cabecinhas 5 years ago
3 changed file(s) with 11 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
2828 uint64_t readBytes(uint8_t *Buf, uint64_t Size,
2929 uint64_t Address) const override;
3030 const uint8_t *getPointer(uint64_t address, uint64_t size) const override {
31 // This could be fixed by ensuring the bytes are fetched and making a copy,
32 // requiring that the bitcode size be known, or otherwise ensuring that
33 // the memory doesn't go away/get reallocated, but it's
34 // not currently necessary. Users that need the pointer don't stream.
35 llvm_unreachable("getPointer in streaming memory objects not allowed");
31 // FIXME: This could be fixed by ensuring the bytes are fetched and
32 // making a copy, requiring that the bitcode size be known, or
33 // otherwise ensuring that the memory doesn't go away/get reallocated,
34 // but it's not currently necessary. Users that need the pointer (any
35 // that need Blobs) don't stream.
36 report_fatal_error("getPointer in streaming memory objects not allowed");
3637 return nullptr;
3738 }
3839 bool isValidAddress(uint64_t address) const override;
156156 RUN: FileCheck --check-prefix=INVALID-ARGUMENT-TYPE %s
157157
158158 INVALID-ARGUMENT-TYPE: Invalid function argument type
159
160 RUN: not llvm-dis -disable-output %p/Inputs/invalid-fixme-streaming-blob.bc 2>&1 | \
161 RUN: FileCheck --check-prefix=STREAMING-BLOB %s
162
163 STREAMING-BLOB: getPointer in streaming memory objects not allowed