summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode/Inputs
Commit message (Collapse)AuthorAgeFilesLines
...
* Change a reachable unreachable to a fatal error.Filipe Cabecinhas2015-05-191-0/+0
| | | | | | | | | | | | | | | 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 llvm-svn: 237709
* [BitcodeReader] Error out if we read an invalid function argument typeFilipe Cabecinhas2015-05-191-0/+0
| | | | | | Bug found with AFL fuzz. llvm-svn: 237650
* [BitcodeReader] It's a malformed block if CodeLenWidth is too bigFilipe Cabecinhas2015-05-191-0/+0
| | | | | | Bug found with AFL fuzz. llvm-svn: 237646
* [BitcodeReader] Make sure the type of the inserted value matches the type of ↵Filipe Cabecinhas2015-05-181-0/+0
| | | | | | | | the aggregate at those indices Bug found with AFL-fuzz. llvm-svn: 237628
* Extract the load/store type verification to a separate function.Filipe Cabecinhas2015-05-181-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Added isLoadableOrStorableType to PointerType. We were doing some checks in some places, occasionally assert()ing instead of telling the caller. With this patch, I'm putting all type checking in the same place for load/store type instructions, and verifying the same thing every time. I also added a check for load/store of a function type. Applied extracted check to Load, Store, and Cmpxcg. I don't have exhaustive tests for all of these, but all Error() calls in TypeCheckLoadStoreInst are being tested (in invalid.test). Reviewers: dblaikie, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9785 llvm-svn: 237619
* [BitcodeReader] Don't allow INSERTVAL/EXTRACTVAL with 0 indicesFilipe Cabecinhas2015-05-162-0/+0
| | | | | | | | This would trigger an assertion later. Bug found with AFL fuzz. llvm-svn: 237494
* Don't overflow GCTableFilipe Cabecinhas2015-04-301-0/+0
| | | | | | | | | | | | Summary: Bug found with AFL fuzz. Reviewers: rafael, dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9361 llvm-svn: 236200
* Make sure Op->getType() is a PointerType before we cast<> it.Filipe Cabecinhas2015-04-301-0/+0
| | | | | | Bug found with AFL fuzz. llvm-svn: 236193
* Make sure we don't resize(0) when we get a fwdref with Idx == UINT_MAXFilipe Cabecinhas2015-04-301-0/+0
| | | | | | | | Make it an error instead. Bug found with AFL fuzz. llvm-svn: 236190
* Check that we have a valid PointerType element type before calling get()Filipe Cabecinhas2015-04-291-0/+0
| | | | | | | | Same as r236073 but for PointerType. Bug found with AFL fuzz. llvm-svn: 236079
* Turn an assert into report_fatal_error since it's reachable based on user inputFilipe Cabecinhas2015-04-291-0/+0
| | | | | | Bug found with AFL fuzz. llvm-svn: 236076
* Make sure that isValidElementType(Type) before calling ↵Filipe Cabecinhas2015-04-292-0/+0
| | | | | | | | {Array,Struct}Type::get(Type) Bug found with AFL fuzz. llvm-svn: 236073
* Relax an assert when there's a type mismatch in forward referencesFilipe Cabecinhas2015-04-281-0/+0
| | | | | | | | | | | | | | | | Summary: We don't seem to need to assert here, since this function's callers expect to get a nullptr on error. This way we don't assert on user input. Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9308 llvm-svn: 236027
* [opaque pointer type] bitcode: add explicit callee type to invoke instructionsDavid Blaikie2015-04-242-0/+0
| | | | llvm-svn: 235735
* [BitcodeReader] Fix asserts when we read a non-vector type for ↵Filipe Cabecinhas2015-04-243-0/+0
| | | | | | | | | | insert/extract/shuffle Added some additional checking for vector types + tests. Bug found with AFL fuzz. llvm-svn: 235710
* Be more strict about the operand for the array type in BitcodeReaderFilipe Cabecinhas2015-04-231-0/+0
| | | | | | | | | | | | Summary: Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9016 llvm-svn: 235596
* Verify sizes when trying to read a BitcodeAbbrevOpFilipe Cabecinhas2015-04-232-0/+0
| | | | | | | | | | | | | | | | Summary: Make sure the abbrev operands are valid and that we can read/skip them afterwards. Bug found with AFL fuzz. Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9030 llvm-svn: 235595
* Have more strict type checks when creating BinOp nodes in BitcodeReaderFilipe Cabecinhas2015-04-221-0/+0
| | | | | | | | | | | | Summary: Bug found with AFL. Reviewers: rafael, bkramer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9015 llvm-svn: 235489
* [opaque pointer type] Explicit pointee type for call instructionDavid Blaikie2015-04-172-0/+0
| | | | | | | | | | Use an extra bit in the CCInfo to flag the newer version of the instructiont hat includes the type explicitly. Tested the newer error cases I added, but didn't add tests for the finer granularity improvements to existing error paths. llvm-svn: 235160
* Revert "Verify sizes when trying to read a VBR"Filipe Cabecinhas2015-04-151-0/+0
| | | | | | | This reverts r234984 since it seems to break some bots (most of them seemed arm*-selfhost). llvm-svn: 234998
* Verify sizes when trying to read a VBRFilipe Cabecinhas2015-04-151-0/+0
| | | | | | Also added an assert to ReadVBR64. llvm-svn: 234984
* Error out of ParseBitcodeInto(Module*) if we haven't read a ModuleFilipe Cabecinhas2015-04-141-0/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: Without this check the following case failed: Skip a SubBlock which is not a MODULE_BLOCK_ID nor a BLOCKINFO_BLOCK_ID Got to end of file TheModule would still be == nullptr, and we would subsequentially fail when materializing the Module (assert at the start of BitcodeReader::MaterializeModule). Bug found with AFL. Reviewers: dexonsmith, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9014 llvm-svn: 234887
* Add testing for mismatched explicit type on a gep operator when loading from ↵David Blaikie2015-03-161-0/+0
| | | | | | bitcode llvm-svn: 232427
* Add testing for mismatched explicit type on a load instruction when loading ↵David Blaikie2015-03-161-0/+0
| | | | | | from bitcode llvm-svn: 232424
* Test bitcode parsing error-handling for incorrect explicit typeDavid Blaikie2015-03-161-0/+0
| | | | | | | | (turns out I had regressed this when sinking handling of this type down into GetElementPtrInst::Create - since that asserted before the error handling was performed) llvm-svn: 232420
* Use common parse routine to read alignment values from bitcodeJF Bastien2015-02-221-0/+0
| | | | | | | | | | While fuzzing LLVM bitcode files, I discovered that (1) the bitcode reader doesn't check that alignments are no larger than 2**29; (2) downstream code doesn't check the range; and (3) for values out of range, corresponding large memory requests (based on alignment size) will fail. This code fixes the bitcode reader to check for valid alignments, fixing this problem. This CL fixes alignment value on global variables, functions, and instructions: alloca, load, load atomic, store, store atomic. Patch by Karl Schimpf (kschimpf@google.com). llvm-svn: 230180
* [Bitcode reader] Fix a few assertions when reading invalid filesFilipe Cabecinhas2015-02-166-0/+0
| | | | | | | | | | | | | | | | Summary: When creating {insert,extract}value instructions from a BitcodeReader, we weren't verifying the fields were valid. Bugs found with afl-fuzz Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7325 llvm-svn: 229345
* Check bit widths before trying to get a type.Filipe Cabecinhas2015-01-301-0/+0
| | | | | | | | | Added a test case for it. Also added run lines for the test case in r227566. Bugs found with afl-fuzz llvm-svn: 227589
* [bitcode reader] Fix an assert on invalid type tablesFilipe Cabecinhas2015-01-301-0/+0
| | | | | | Bug found with afl-fuzz llvm-svn: 227566
* [Bitcode] Diagnose errors instead of asserting from bad inputFilipe Cabecinhas2015-01-243-0/+2
| | | | | | | | | | | | | | | Eventually we can make some of these pass the error along to the caller. Reports a fatal error if: We find an invalid abbrev record We try to get an invalid abbrev number We can't fill the current word due to an EOF Fixed an invalid bitcode test to check for output with FileCheck Bugs found with afl-fuzz llvm-svn: 226986
* Use report_fatal_error instead of llvm_unreachable, so we don't crash on ↵Filipe Cabecinhas2015-01-161-0/+0
user input llvm-svn: 226248
OpenPOWER on IntegriCloud