diff options
author | Alex Lorenz <arphaman@gmail.com> | 2014-08-22 16:29:45 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2014-08-22 16:29:45 +0000 |
commit | 5117674f55a7d9f4359cf1ad9f1591db9997b231 (patch) | |
tree | 1bce7c07ff5b3fcabbd7eaba0ee282f7abe2bf53 /llvm/unittests/Support/LEB128Test.cpp | |
parent | e9c6479c4dfc44abcec945de1bf924c37d819acc (diff) | |
download | llvm-5117674f55a7d9f4359cf1ad9f1591db9997b231.zip llvm-5117674f55a7d9f4359cf1ad9f1591db9997b231.tar.gz llvm-5117674f55a7d9f4359cf1ad9f1591db9997b231.tar.bz2 |
[Support] Fix the overflow bug in ULEB128 decoding.
Differential Revision: http://reviews.llvm.org/D5029
llvm-svn: 216268
Diffstat (limited to 'llvm/unittests/Support/LEB128Test.cpp')
-rw-r--r-- | llvm/unittests/Support/LEB128Test.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/unittests/Support/LEB128Test.cpp b/llvm/unittests/Support/LEB128Test.cpp index b1ca13e..14a6d3f 100644 --- a/llvm/unittests/Support/LEB128Test.cpp +++ b/llvm/unittests/Support/LEB128Test.cpp @@ -106,6 +106,7 @@ TEST(LEB128Test, DecodeULEB128) { EXPECT_DECODE_ULEB128_EQ(0xffu, "\xff\x01"); EXPECT_DECODE_ULEB128_EQ(0x100u, "\x80\x02"); EXPECT_DECODE_ULEB128_EQ(0x101u, "\x81\x02"); + EXPECT_DECODE_ULEB128_EQ(4294975616ULL, "\x80\xc1\x80\x80\x10"); // Decode ULEB128 with extra padding bytes EXPECT_DECODE_ULEB128_EQ(0u, "\x80\x00"); |