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?



OK then -- committed as attached.


Phil Muldoon wrote:
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:

2011-02-28  Michael Snyder  <msnyder@vmware.com>

	* python/py-param.c (set_parameter_value): Add missing
	break statement.

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	28 Feb 2011 18:25:29 -0000
@@ -214,9 +214,8 @@ set_parameter_value (parmpy_object *self
 	    self->value.autoboolval = AUTO_BOOLEAN_TRUE;
 	  else 
 	    self->value.autoboolval = AUTO_BOOLEAN_FALSE;
-
-	  break;
 	}
+      break;
 
     case var_integer:
     case var_zinteger:

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