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

Alex L arphaman at gmail.com
Wed May 20 11:16:39 PDT 2015


2015-05-20 11:13 GMT-07:00 Duncan P. N. Exon Smith <dexonsmith at apple.com>:

>
> > On 2015 May 20, at 09:59, Alex Lorenz <arphaman at gmail.com> wrote:
> >
> > 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,
>
> Is this a bug?  Should LLexer be fixed instead?
>

Yeah, It might be better to fix LLLexer instead. I will resubmit the patch
with LLLexer changes then.

Alex.


>
> > 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/
> > <D9883.26156.patch>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150520/cd54a307/attachment.html>


More information about the llvm-commits mailing list