summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-06-02 06:21:44 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-06-02 06:21:44 +0000
commit8c79db174110e23d5f5652c1bdf7249b93d4c7a5 (patch)
treed2d03da0e32f9945c88b2906e31636eb5ad3de6d /llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
parentafefa67310faca9419ca662ba0f7a2045c6fc1cc (diff)
downloadbcm5719-llvm-8c79db174110e23d5f5652c1bdf7249b93d4c7a5.tar.gz
bcm5719-llvm-8c79db174110e23d5f5652c1bdf7249b93d4c7a5.zip
[CodeView] Take the StreamRef::readBytes offset into account when validating
We only considered the length of the operation and the length of the StreamRef without considered what it meant for the offset to be at a non-zero position. llvm-svn: 271496
Diffstat (limited to 'llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
index f40ac356a0d..75e954df411 100644
--- a/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
+++ b/llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
@@ -79,6 +79,8 @@ TEST(MappedBlockStreamTest, ReadBeyondEndOfStreamRef) {
EXPECT_NO_ERROR(R.readStreamRef(SR, 0U));
ArrayRef<uint8_t> Buffer;
EXPECT_ERROR(SR.readBytes(0U, 1U, Buffer));
+ EXPECT_NO_ERROR(R.readStreamRef(SR, 1U));
+ EXPECT_ERROR(SR.readBytes(1U, 1U, Buffer));
}
// Tests that a read which outputs into a full destination buffer works and
OpenPOWER on IntegriCloud