Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(824)

Issue 5177042: [pph] Detect state mutation in DECLs/TYPEs [7/8] (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by Diego Novillo
Modified:
12 years, 6 months ago
Reviewers:
CC:
Lawrence Crowl, gcc-patches_gcc.gnu.org
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -4 lines) Patch
M gcc/cp/ChangeLog.pph View 1 chunk +6 lines, -0 lines 0 comments Download
M gcc/cp/pph-streamer-in.c View 1 chunk +1 line, -1 line 0 comments Download
M gcc/cp/pph-streamer-out.c View 1 chunk +5 lines, -3 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 7 months ago (2011-10-03 15:33:13 UTC) #1
Another fixlet.  All the pph cache lookup routines accept NULL index
pointers when the caller does not care for them.  So should
pph_get_marker_for.

	* pph-streamer-in.c (pph_read_namespace_tree): Initialize EXPR.
 	* pph-streamer-out.c (pph_get_marker_for): Handle NULL values
	for INCLUDE_IX_P and IX_P.

diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index 3cbe168..a2bad3d 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -2098,7 +2098,7 @@ pph_read_namespace_tree (pph_stream *stream, tree
enclosing_namespace)
 {
   struct lto_input_block *ib = stream->encoder.r.ib;
   struct data_in *data_in = stream->encoder.r.data_in;
-  tree expr;
+  tree expr = NULL_TREE;
   enum pph_record_marker marker;
   unsigned image_ix, ix;
   enum LTO_tags tag;
diff --git a/gcc/cp/pph-streamer-out.c b/gcc/cp/pph-streamer-out.c
index f46c849..516eabb 100644
--- a/gcc/cp/pph-streamer-out.c
+++ b/gcc/cp/pph-streamer-out.c
@@ -239,8 +239,11 @@ static enum pph_record_marker
 pph_get_marker_for (pph_stream *stream, void *data, unsigned *include_ix_p,
                     unsigned *ix_p)
 {
-  *ix_p = -1u;
-  *include_ix_p = -1u;
+  if (ix_p)
+    *ix_p = -1u;
+
+  if (include_ix_p)
+    *include_ix_p = -1u;
 
   /* We represent NULL pointers with PPH_RECORD_END.  */
   if (data == NULL)
-- 
1.7.3.1


--
This patch is available for review at http://codereview.appspot.com/5177042
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b