AsmParser: Require a terminating null character when creating memory buffer.
authorAlex Lorenz <arphaman@gmail.com>
Wed, 20 May 2015 20:41:27 +0000 (20:41 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 20 May 2015 20:41:27 +0000 (20:41 +0000)
commit3f1b2bdf5d379cb9dc29f359033f567b921926ff
tree7035e86b74bf5ca63bce4b75a97301ccf8b51869
parente86ba4b5710d51359fb9e66c529ca4a56c9e59fb
AsmParser: Require a terminating null character when creating memory buffer.

This commit modifies the memory buffer creation in the AsmParser library so
that it requires a terminating null character. The LLLexer in the AsmParser
library checks for EOF only when it sees a null character, thus it would
be best to require it when creating a memory buffer so that the memory
buffer constructor can verify that a terminating null character is indeed
present.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun

Differential Revision: http://reviews.llvm.org/D9883

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237833 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AsmParser/Parser.cpp
unittests/AsmParser/AsmParserTest.cpp [new file with mode: 0644]
unittests/AsmParser/CMakeLists.txt [new file with mode: 0644]
unittests/AsmParser/Makefile [new file with mode: 0644]
unittests/CMakeLists.txt
unittests/Makefile