[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GLR init

From: Paul Eggert
Subject: Re: GLR init
Date: Thu, 21 Jul 2005 15:17:26 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden writes:

> if first malloc() fails in yyinitGLRStack()then
> the second one is done because it is missing :
> `if (!yystack->yyitems) return false; ' (line 975)

But if that line is inserted into yyinitGLRStack, then
yyinitStateSet won't be called, which means that yytops.yystates
will be garbage, which can cause the code after yyreturn to crash.

> Can be assumed Bison generated GLR parsers are
> used on specialistic embedded GNU/Linux micro
> controllers with different c-libs which possibly
> do not like such situation.

Why wouldn't such implementations work with th the current code?  I
don't see any undefined behavior.

Or are you worried about efficiency?  I.e., that the second malloc
doesn't need to be called if the first malloc fails?  I don't think we
need to worry about that sort of optimization in this (presumably)
unusual error case.  It's better to keep the code short and simple.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]