bison-patches
[Top][All Lists]
Advanced

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

Re: remove unportable casts and storage allocation tricks from Bison


From: Akim Demaille
Subject: Re: remove unportable casts and storage allocation tricks from Bison
Date: Fri, 10 Jan 2003 14:12:58 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

 >> From: Akim Demaille <address@hidden>
 >> Date: Thu, 09 Jan 2003 10:12:47 +0100
 >> 
 Paul> Some architectures don't let you compute pointers to places that
 Paul> aren't really storage.
 >> 
 >> I've heard that too, but saw no evidence of this either.

 Paul> I tracked down one example of an architecture that has the problem:
 Paul> the 80386 (and later) in 32-bit mode if the large array is allocated
 Paul> in a separate segment.  In this case the nonconforming pointer
 Paul> arithmetic can change the segment number causing a segment fault, even
 Paul> if the resulting pointer is not dereferenced.  The x86 architecture is
 Paul> still fairly popular, so this is of some practical concern.

Thanks Paul.  Actually, I know for this architecture, but it seems to
have been the original platform for Bison [1], so the risk doesn't
seem to have been "exercised".

[1] My favorite comment in Bison, that I do not want to remove nor
update is in reduce.c:

/*-------------------------------------------------------------------.
| Another way to do this would be with a set for each production and |
| then do subset tests against N0, but even for the C grammar the    |
| whole reducing process takes only 2 seconds on my 8Mhz AT.         |
`-------------------------------------------------------------------*/

:)




reply via email to

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