diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-02 00:08:19 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-11-02 00:08:19 +0000 |
commit | 028eb5a3f823c25e6c3040d300910e23ed69e788 (patch) | |
tree | 9d3065523337ebcf7489b238e95435c17c14a273 /llvm/test/Bitcode | |
parent | ce898dbb8135f1bd6b9b94c851bc0f8e99b72330 (diff) | |
download | bcm5719-llvm-028eb5a3f823c25e6c3040d300910e23ed69e788.tar.gz bcm5719-llvm-028eb5a3f823c25e6c3040d300910e23ed69e788.zip |
Bitcode: Change reader interface to take memory buffers.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html
This change also fixes an API oddity where BitstreamCursor::Read() would
return zero for the first read past the end of the bitstream, but would
report_fatal_error for subsequent reads. Now we always report_fatal_error
for all reads past the end. Updated clients to check for the end of the
bitstream before reading from it.
I also needed to add padding to the invalid bitcode tests in
test/Bitcode/. This is because the streaming interface was not checking that
the file size is a multiple of 4.
Differential Revision: https://reviews.llvm.org/D26219
llvm-svn: 285773
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-array-operand-encoding.bc | bin | 579 -> 580 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-code-len-width.bc | bin | 173 -> 176 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-extractval-array-idx.bc | bin | 450 -> 452 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-function-comdat-id.bc | bin | 489 -> 492 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc | bin | 617 -> 620 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc | bin | 878 -> 880 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-name-with-0-byte.bc | bin | 1265 -> 1268 bytes | |||
-rw-r--r-- | llvm/test/Bitcode/Inputs/invalid-unexpected-eof.bc | 2 |
8 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Bitcode/Inputs/invalid-array-operand-encoding.bc b/llvm/test/Bitcode/Inputs/invalid-array-operand-encoding.bc Binary files differindex f7ec2eb700a..2256fce555d 100644 --- a/llvm/test/Bitcode/Inputs/invalid-array-operand-encoding.bc +++ b/llvm/test/Bitcode/Inputs/invalid-array-operand-encoding.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-code-len-width.bc b/llvm/test/Bitcode/Inputs/invalid-code-len-width.bc Binary files differindex c8e8c4f6653..c8c3c104f84 100644 --- a/llvm/test/Bitcode/Inputs/invalid-code-len-width.bc +++ b/llvm/test/Bitcode/Inputs/invalid-code-len-width.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-extractval-array-idx.bc b/llvm/test/Bitcode/Inputs/invalid-extractval-array-idx.bc Binary files differindex 7465df361c0..7234e0d6daa 100644 --- a/llvm/test/Bitcode/Inputs/invalid-extractval-array-idx.bc +++ b/llvm/test/Bitcode/Inputs/invalid-extractval-array-idx.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-function-comdat-id.bc b/llvm/test/Bitcode/Inputs/invalid-function-comdat-id.bc Binary files differindex d0ad8234bc8..11e024120d2 100644 --- a/llvm/test/Bitcode/Inputs/invalid-function-comdat-id.bc +++ b/llvm/test/Bitcode/Inputs/invalid-function-comdat-id.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc b/llvm/test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc Binary files differindex 8e38340eede..41011f76ce8 100644 --- a/llvm/test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc +++ b/llvm/test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc b/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc Binary files differindex 42a2c3e65fe..dbd8933fd2f 100644 --- a/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc +++ b/llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-name-with-0-byte.bc b/llvm/test/Bitcode/Inputs/invalid-name-with-0-byte.bc Binary files differindex 9c6a9158eee..c38e363c24b 100644 --- a/llvm/test/Bitcode/Inputs/invalid-name-with-0-byte.bc +++ b/llvm/test/Bitcode/Inputs/invalid-name-with-0-byte.bc diff --git a/llvm/test/Bitcode/Inputs/invalid-unexpected-eof.bc b/llvm/test/Bitcode/Inputs/invalid-unexpected-eof.bc index a487393d066..02a22e44082 100644 --- a/llvm/test/Bitcode/Inputs/invalid-unexpected-eof.bc +++ b/llvm/test/Bitcode/Inputs/invalid-unexpected-eof.bc @@ -1 +1 @@ -BCÀÞ!00000000000000000000
\ No newline at end of file +BCÀÞ!000000000000000000000
\ No newline at end of file |