public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pph] pph_in_binding_level fixing shadowed_labels read (issue4589054)
@ 2011-06-14 18:26 Gabriel Charette
  2011-06-14 19:41 ` Diego Novillo
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Charette @ 2011-06-14 18:26 UTC (permalink / raw)
  To: reply, crowl, dnovillo, gcc-patches

We weren't reading in shadowed labels properly.

The local variable *sl also turned out to be useless, the compiler just didn't
mention it until now as it was "used" by the bad VEC_iterate call.

This doesn't fix any currently exposed pph bugs, but does help with me with
the patch I'm currently writting.

This was tested with a bootstrap build and pph regression testing.


2011-06-14  Gabriel Charette  <gchare@google.com>

	* pph-streamer-in.c (pph_in_binding_level): Fix read
	of shadowed_labels.
	(pph_in_binding_level): Removed *sl.

Index: pph-streamer-in.c
===================================================================
--- pph-streamer-in.c	(revision 174998)
+++ pph-streamer-in.c	(working copy)
@@ -427,7 +427,6 @@
 pph_in_binding_level (pph_stream *stream)
 {
   unsigned i, num, ix;
-  cp_label_binding *sl;
   struct cp_binding_level *bl;
   struct bitpack_d bp;
   enum pph_record_marker marker;
@@ -461,7 +460,7 @@
 
   num = pph_in_uint (stream);
   bl->shadowed_labels = NULL;
-  for (i = 0; VEC_iterate (cp_label_binding, bl->shadowed_labels, i, sl); i++)
+  for (i = 0; i < num; i++)
     {
       cp_label_binding *sl = pph_in_label_binding (stream);
       VEC_safe_push (cp_label_binding, gc, bl->shadowed_labels, sl);

--
This patch is available for review at http://codereview.appspot.com/4589054

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pph] pph_in_binding_level fixing shadowed_labels read (issue4589054)
  2011-06-14 18:26 [pph] pph_in_binding_level fixing shadowed_labels read (issue4589054) Gabriel Charette
@ 2011-06-14 19:41 ` Diego Novillo
  0 siblings, 0 replies; 2+ messages in thread
From: Diego Novillo @ 2011-06-14 19:41 UTC (permalink / raw)
  To: Gabriel Charette; +Cc: reply, Lawrence Crowl, gcc-patches

On Tue, Jun 14, 2011 at 13:59, Gabriel Charette <gchare@google.com> wrote:

> 2011-06-14  Gabriel Charette  <gchare@google.com>
>
>        * pph-streamer-in.c (pph_in_binding_level): Fix read
>        of shadowed_labels.
>        (pph_in_binding_level): Removed *sl.

OK, committed as rev 175050.


Diego.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-14 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-14 18:26 [pph] pph_in_binding_level fixing shadowed_labels read (issue4589054) Gabriel Charette
2011-06-14 19:41 ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).