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]

Re: Prevent seg fault on buggy input


  In message <200005222352.QAA16908@elmo.cygnus.com>you write:
  > Hi Richard, Hi Jeff,
  > 
  > : > Then it continues on to try to evaluate the assignment to foo.  It
  > : > calls finish_decl() but the 'init' tree just contains an error decl
  > : > inside a NON_LVALUE_EXPR:
  > : > 
  > : > (gdb) call debug_tree (init)
  > : >  <non_lvalue_expr 0x401168a0 type <error_mark 0x40015440>
  > : >     arg 0 <error_mark 0x40015440>>
  > : 
  > : This is where things went wrong, IMO.
  > 
  > OK, how about this patch instead ?  It detects the error mark inside
  > finish_decl before store_init_value() is called.
  > 
  > Cheers
  > 	Nick
  > 
  > 
  > 2000-05-22  Nick Clifton  <nickc@cygnus.com>
  > 
  > 	* c-decl.c (finish_decl): Do not attempt to store an init
  > 	value if it is erroneous.
Did this ever get addressed?

I can't find the testcase for this, so I can't do any investigation myself
(and since I don't know this area of the compiler well, it's hard for me
to just read and know what the right thing to do is :-)

jeff


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