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]

[C++ PATCH]: Fix 11282


Mark,
here's the obvious fix for 11282, which causes 3.3 to go loopy.

I've not yet checked if it is appropriate for 3.4 - either it
is, or that bit of code is unreachable and should be asserted as
such. I'll figure what to do there.

built & tested on i686-pc-linux-gnu, ok for branch?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-07-23  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/11282
	* decl.c: (reshape_init): Always advance *INITP.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.965.2.56
diff -c -3 -p -r1.965.2.56 decl.c
*** cp/decl.c	11 Jul 2003 12:02:22 -0000	1.965.2.56
--- cp/decl.c	23 Jul 2003 13:39:20 -0000
*************** reshape_init (tree type, tree *initp)
*** 8202,8207 ****
--- 8202,8208 ----
      {
        my_friendly_assert (TREE_CODE (old_init) == TREE_LIST, 20021202);
        TREE_VALUE (old_init) = error_mark_node;
+       *initp = TREE_CHAIN (old_init);
        return old_init;
      }
  
// { dg-do compile }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 23 Jul 2003 <nathan@codesourcery.com>

// PR 11282. Infinite loop/memory consumption

struct parameter_struct_t {
  char short_option;
  char *long_option;
};

parameter_struct_t *parameters[] = {
  {
    'f'; // { dg-error "error before" "" }
    "from";
  };
};


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