[RFC] logic change in m2-valprint.c

Michael Snyder msnyder@sonic.net
Sun Jul 1 15:54:00 GMT 2007




> On Thu, Jun 28, 2007 at 05:29:55PM -0700, Michael Snyder wrote:
> > I'm really not sure about this, call it a shot in the dark.
> >
> > The logic doesn't make sense as it is (the condition can't be true),
> > so I figured maybe the conditional had been reversed by mistake.
> >
> > Either that, or the two lines should be removed, 'cause they're dead.
> >
>
> > 2007-06-28  Michael Snyder  <msnyder@access-company.com>
> >
> > * m2-valprint.c (m2_print_long_set): Logical condition reversed
> > (Coverity).
>
> It can't be backwards; this is trying to print "1" or "1, 2" but your
> change would make it print ", 1" and ", 12".
>
> I think it's also trying to shorten ranges to "{1..3, 6..7}".  The
> bug's got to be in there somewhere.  Why's the code dead?  I'm not
> seeing it... element_seen can be reset by the bit clear case, and then
> we'll get into the test you're changing again.

'Cause we're not in a loop, and it's not a static variable.
The code is serial.  At entry we set empty_set to one, and
then we test to see if it's zero.  It can't be zero.





More information about the Gdb-patches mailing list