This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [fixme] case statement without break -- intentional?
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 28 Feb 2011 12:38:41 +0000
- Subject: Re: [fixme] case statement without break -- intentional?
- References: <4D696784.3070801@vmware.com>
- Reply-to: pmuldoon at redhat dot com
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: