DescriptionFix abbreviation handling in munged bitcode writer.
The bitstream writer assumes several properties, and will fail
(either through assert or core dump) if these properties aren't
true. Fixing munged bitcode writer to handle the following
assumptions:
1) Don't write out an abbreviation if the abbreviation can't be
applied to the record.
2) Don't write out an abbreviation definition if the record doesn't
define a valid abbreviation (previous code was checking this, but
not correctly for the abbreviation operand).
3) Don't use abbreviations whose abbreviation index is larger than
couldn't be written out (case 2). Such indices will be broken because
the bitstream reader doesn't correctly match.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=4169
R=jvoung@chromium.org
Committed: https://chromium.googlesource.com/native_client/pnacl-llvm/+/e439162d4e1a4b422cab9dfc07819f891f633306
Patch Set 1 #Patch Set 2 : Fix nits. #Patch Set 3 : Don't allow application of abbreviation if index out of range. #
Total comments: 39
Patch Set 4 : Fix isses raised in patch set 3. #
Total comments: 4
Patch Set 5 : Fix nits. #
Messages
Total messages: 9 (1 generated)
|