[fixme] case statement without break -- intentional?
Phil Muldoon
pmuldoon@redhat.com
Mon Feb 28 14:07:00 GMT 2011
Michael Snyder <msnyder@vmware.com> writes:
> This one looks like an accident, but I can't be sure.
> Phil?
Sure looks it to me. If the case is:
case var_auto_boolean:
And the value is the Python None, then
self->value.autoboolval = AUTO_BOOLEAN_AUTO;
happens, and it should break (your later comment, with the break needing
to be outside of the brace is correct). Otherwise it will (incorrectly)
go on to process:
case var_integer:
case var_zinteger:
case var_uinteger:
Which will eventually trigger a PyInt_Check error.
Cheers
Phil
> Index: python/py-param.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/python/py-param.c,v
> retrieving revision 1.8
> diff -u -p -u -p -r1.8 py-param.c
> --- python/py-param.c 26 Jan 2011 20:53:45 -0000 1.8
> +++ python/py-param.c 26 Feb 2011 20:48:40 -0000
> @@ -217,7 +217,7 @@ set_parameter_value (parmpy_object *self
>
> break;
> }
> -
> + /* FIXME -- fall through??? Maybe above break belongs outside brace? */
> case var_integer:
> case var_zinteger:
> case var_uinteger:
More information about the Gdb-patches
mailing list