DescriptionFix the NaCl bitstream reader to report fatal errors.
The current code has several asserts on bitcode file read values. This
results in assert errors for badly user-defined input, causing the
application to crash. This CL Fixes this problem by providing an error
handling class (that can be overridden) to define how fatal errors
should be handled by the bitstream reader.
It also consolidates the printing of bit addresses into one place, and
then uses this to prefix (default) bitstream error messages.
It also fixes a bug where the NaClBitcodeReader/NaClBitcodeParser bit positions were
relative to the first bit after the header, rather than at
the beginning of the bitcode file.
This fixes pnacl-bcdis from core dumping on bitcode file specified in
bug 4002, since it has an illegal abbreviation index in the bitcode
file.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4002
R=jvoung@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=fad799848e661f81adfeca53660cd5b454928380
Patch Set 1 #Patch Set 2 : Allow bit position to be associated with parse errors. #Patch Set 3 : Fix nits and comments. #Patch Set 4 : Fix cursor placement and add unit tests. #Patch Set 5 : Fix nits. #Patch Set 6 : Fix formatting. #
Total comments: 35
Patch Set 7 : Fix issues raised in last patch. #Patch Set 8 : Fix nits. #
Total comments: 12
Patch Set 9 : Fix issues raised in patch set 8. #
Total comments: 2
Patch Set 10 : Fix nit in last patch. #Patch Set 11 : Updated patch after LLVM 3.6 merge #Patch Set 12 : Port to LLVM 3.6 #Patch Set 13 : Merge with master #Messages
Total messages: 9 (1 generated)
|