[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [csmith-bugs] Uninitialized field of union
No, the logic is correct. It's the way that field id was assigned gets
screwed up when there is 0-length bit-fields.
I have fixed it in commit ea4762. Thanks for the bug report, Pascal.
-Xuejun
>
> Xuejun, is the CRC logic at the end somehow bypassing your normal safety
> checks? Maybe there's a better way to reuse your existing code...
>
> John
>
>
>
> On 8/23/11 2:13 PM, Pascal Cuoq wrote:
> > Hello,
> >
> > this is a continuation to a thread about accessing at CRC-time
> > members of unions through which an initialization
> > has not occurred. The last message in the thread was
> > http://www.flux.utah.edu/listarchives/csmith-dev/msg00232.html .
> >
> > The example below is very similar to the program that started that
thread:
> > an union is initialized through a particular member, and at CRC-time,
> > the union is read from through another, wider member.
> >
> > The example was generated with the last version as of now:
> >
> > /*
> > * This is a RANDOMLY GENERATED PROGRAM.
> > *
> > * Generator: csmith 2.1.0
> > * Git version: b911750
> > * Options: --max-pointer-depth 3 --max-funcs 2 --max-array-dim 2
> > --max-array-len-per-dim 3 --max-struct-fields 5 --no-volatiles --no-argc
> > --unions
> > * Seed: 2541560484
> > */
> >
> > Line 230 reads on the first iteration 32 bits from the beginning of
> > g_17, whereas only 11 bits have been initialized through f0.
> >
> > Should we start providing platform.info <http://platform.info> with bug
> > reports,
> > since it influences the generation of programs? Here's mine:
> >
> > integer size = 4
> > pointer size = 8
> >
> > Pascal
> >