This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fixme] case statement without break -- intentional?


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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]