[LLVMdev] tblgen: Assertion failed: "Buffer[Length-1] == '"'", file FileLexer.l, line 114

Chris Lattner sabre at nondot.org
Tue Aug 17 19:39:23 PDT 2004


On Wed, 18 Aug 2004, Henrik Bach wrote:
> I think I've found the error:
>
> The Buffer contains: include "../Target.td" and length is 23.
> The file that tablegen is looking for is therefore: "../Target.td".
>
> However, in the assertion you assert an empty buffer and that is not what
> you want, I suppose. If you change line 114 to != instead ==, then the
> assertion doesn't fail.

No, that can't be right.  The regex being used is:

   include[ \t\n]+\"[^"]*\"

Given that, the buffer you pasted makes perfect sense, but the length
(which comes from yylen) should be 22, not 23.  Because yylen is 22,
tblgen is inspecting the char past the ", thus the assertion.  Changing
the assertion papers over the problem, leading to this problem:

> The next problem, on my system (Interix - you remember - Hey, some LLVM
> program is working :O ), is however, that it cannot find the ../Target.td
> file. At the moment I see some more bugs luring ahead in the TableGen code.
> More on that later.

I'm sure this is because you hacked the assertion, but didn't fix the
problem.  The question is: why is an extra char being included at the end
of the buffer?

-Chris

-- 
http://llvm.org/
http://nondot.org/sabre/




More information about the llvm-dev mailing list