* [patch] Fix unintended fall-through in dump_subexp_body_standard
@ 2009-03-03 0:13 Paul Pluzhnikov
2009-03-03 0:24 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Paul Pluzhnikov @ 2009-03-03 0:13 UTC (permalink / raw)
To: gdb-patches
Greetings,
The code currently in dump_subexp_body_standard() looks "obviously
wrong" to me, but perhaps I am missing something ...
Thanks,
--
Paul Pluzhnikov
2009-03-02 Paul Pluzhnikov <ppluzhnikov@google.com>
* expprint.c (dump_subexp_body_standard): Fix unintended fall-through.
Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.35
diff -u -p -u -r1.35 expprint.c
--- expprint.c 3 Jan 2009 05:57:51 -0000 1.35
+++ expprint.c 3 Mar 2009 00:11:08 -0000
@@ -889,6 +889,7 @@ dump_subexp_body_standard (struct expres
case TERNOP_SLICE:
case TERNOP_SLICE_COUNT:
elt = dump_subexp (exp, stream, elt);
+ break;
case BINOP_ADD:
case BINOP_SUB:
case BINOP_MUL:
@@ -927,6 +928,7 @@ dump_subexp_body_standard (struct expres
case STRUCTOP_MEMBER:
case STRUCTOP_MPTR:
elt = dump_subexp (exp, stream, elt);
+ break;
case UNOP_NEG:
case UNOP_LOGICAL_NOT:
case UNOP_COMPLEMENT:
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [patch] Fix unintended fall-through in dump_subexp_body_standard
2009-03-03 0:13 [patch] Fix unintended fall-through in dump_subexp_body_standard Paul Pluzhnikov
@ 2009-03-03 0:24 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2009-03-03 0:24 UTC (permalink / raw)
To: Paul Pluzhnikov; +Cc: gdb-patches
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> The code currently in dump_subexp_body_standard() looks "obviously
Paul> wrong" to me, but perhaps I am missing something ...
I think it is intended.
Paul> case TERNOP_SLICE:
Paul> case TERNOP_SLICE_COUNT:
Paul> elt = dump_subexp (exp, stream, elt);
This prints the first element of a node with 3 operands.
dump_subexp returns the index of the following element.
Then it falls through to the code to print a node with 2 operands.
Likewise the 2 operand code falls through to the 1 operand case.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-03 0:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-03 0:13 [patch] Fix unintended fall-through in dump_subexp_body_standard Paul Pluzhnikov
2009-03-03 0:24 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox