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

Issue 5905065: [pph] Fix check for empty statement list

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by Diego Novillo
Modified:
12 years, 1 month 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 (+6 lines, -3 lines) Patch
M gcc/cp/ChangeLog.pph View 1 chunk +5 lines, -0 lines 0 comments Download
M gcc/cp/pph-out.c View 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
12 years, 1 month ago (2012-03-26 16:11:34 UTC) #1
Fix check for empty statement list.

We do some sanity checks before starting to write a PPH image.  The
check was inconsistent: for the VEC scope_chain->x_stmt_tree.x_cur_stmt_list
we were asserting that it was NULL *and* empty.

We just need it to be empty.  It doesn't matter if it was allocated.

2012-03-25   Diego Novillo  <dnovillo@google.com>

	* pph-out.c (pph_out_global_binding_keys): Fix check for empty
	statement list.
---
 gcc/cp/ChangeLog.pph |    5 +++++
 gcc/cp/pph-out.c     |    3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/cp/ChangeLog.pph b/gcc/cp/ChangeLog.pph
index 1cf90b4..f5b8281 100644
--- a/gcc/cp/ChangeLog.pph
+++ b/gcc/cp/ChangeLog.pph
@@ -1,5 +1,10 @@
 2012-03-25   Diego Novillo  <dnovillo@google.com>
 
+	* pph-out.c (pph_out_global_binding_keys): Fix check for empty
+	statement list.
+
+2012-03-25   Diego Novillo  <dnovillo@google.com>
+
 	* mangle.c (write_expression): Handle TRAIT_EXPR when PPH is enabled.
 	(write_template_arg_literal): Handle CONST_DECLs that do not have
 	a constant DECL_INITIAL when PPH is enabled.
diff --git a/gcc/cp/pph-out.c b/gcc/cp/pph-out.c
index 7ba4ee6..1efac6b 100644
--- a/gcc/cp/pph-out.c
+++ b/gcc/cp/pph-out.c
@@ -2604,8 +2604,7 @@ pph_out_global_binding_keys (pph_stream *stream)
 		   || scope_chain->x_processing_template_decl
 		   || scope_chain->x_processing_specialization
 		   || scope_chain->x_processing_explicit_instantiation
-		   || scope_chain->need_pop_function_context
-		   || scope_chain->x_stmt_tree.x_cur_stmt_list)
+		   || scope_chain->need_pop_function_context)
 	      && VEC_empty (tree, scope_chain->x_stmt_tree.x_cur_stmt_list));
 
   /* We need to write a record for BL before emitting the merge keys
-- 
1.7.7.3


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

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