tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] tccgen.c: off by one in flexible array members


From: Henry Kroll
Subject: Re: [Tinycc-devel] tccgen.c: off by one in flexible array members
Date: Sat, 12 Mar 2016 16:08:06 -0800

>This still isn't quite right.  The thing is, type->ref.c is -1 for
> an 
> unused flex array, so with your example ("char mem[]") your change 
> basically boils down to "size += -1 * 1 + 1" (i.e. +=0).  But with a 
> different type (say int) it's now "size += -1 * 4 + 1" (i.e.
> +=3).  So 
> this example still fails the same way:

Good catch and patch. Didn't realize type->ref.c could be -1. Seems to
be fixed now.



reply via email to

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