[PATCH] AsmParser: Require null terminator in the created memory buffer.

Alex Lorenz arphaman at gmail.com
Wed May 20 09:59:59 PDT 2015


Hi dexonsmith, rafael,

This patch modifies the memory buffer creation in the AsmParser library so that is requires a terminating null character.
This change is needed because LLLexer in AsmParser checks for EOF when it sees the null character, but the memory buffer
that's being created with the source assumes that the terminating null character isn't required.

I was motivated to submit this patch as my initial MIR commit had the problem where the input to the AsmParser wasn't null
terminated and it would have been better to catch it with an assertion early on.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9883

Files:
  lib/AsmParser/Parser.cpp
  unittests/AsmParser/AsmParserTest.cpp
  unittests/AsmParser/CMakeLists.txt
  unittests/AsmParser/Makefile
  unittests/CMakeLists.txt
  unittests/Makefile

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9883.26156.patch
Type: text/x-patch
Size: 3691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150520/1dc20461/attachment.bin>


More information about the llvm-commits mailing list