This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[patch java]: Avoid looping over the end_params_node in put_decl_node


Hi,

this patch makes sure we don't walk in put_decl_node of the
end_params_node element.

ChangeLog

2013-03-22  Kai Tietz  <ktietz@redhat.com>

        * lang.c (put_decl_node): Don't iterate over end_params_node.

Tested for i686-w64-mingw32, x86_64-w64-mingw32, and
x86_64-unknown-linux-gnu.  Ok for apply?

Regards,
Kai

Index: gcc/java/lang.c
===================================================================
--- gcc/java/lang.c	(Revision 196898)
+++ gcc/java/lang.c	(Arbeitskopie)
@@ -419,7 +419,8 @@ put_decl_node (tree node, int verbosity)
 	      if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
 		args = TREE_CHAIN (args);
 	      put_decl_string ("(", 1);
-	      for ( ; args != end_params_node;  args = TREE_CHAIN (args), i++)
+	      for ( ; args != NULL_TREE && args != end_params_node;
+		   args = TREE_CHAIN (args), i++)
 		{
 		  if (i > 0)
 		    put_decl_string (",", 1);


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