raw_ostream::operator<<(StringRef): Avoid potential overflow in pointer arithmetic.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 30 Apr 2014 09:33:50 +0000 (09:33 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 30 Apr 2014 09:33:50 +0000 (09:33 +0000)
commit5f4aba6c8a73b51f583da7f4823c04531bfeb2ab
treedc7fc14a36d8592a78919cc4bde5fecaac94170b
parent5b188b1cb8de7b7973aceecef08ee5ce44ee2cfc
raw_ostream::operator<<(StringRef): Avoid potential overflow in pointer arithmetic.

(OutBufCur + Size) might overflow if Size were large. For example on i686-linux,

  OutBufCur: 0xFFFDF27D
  OutBufEnd: 0xFFFDF370
  Size:      0x0002BF20 (180,000)

It caused flaky error in MC/COFF/section-name-encoding.s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207621 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/raw_ostream.h