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]

Patch for bootstrap problem compiling tinfo.cc


The following patch fixes a bootstrap problem on arm-netbsd; I've based it 
on a similar patch by Mark Mitchell for preserve_subexpression_p().  The 
symptom was a segmentation fault when dereferencing block_stack because 
current_function->stmt was NULL.

<date>  Richard Earnshaw (rearnsha@arm.com)

	* stmt.c (any_pending_cleanups): Don't crash when 
	current_function->stmt is unset.


Index: stmt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/stmt.c,v
retrieving revision 1.95
diff -p -r1.95 stmt.c
*** stmt.c	1999/09/17 22:18:39	1.95
--- stmt.c	1999/09/18 12:58:39
*************** any_pending_cleanups (this_contour)
*** 4333,4339 ****
  {
    struct nesting *block;
  
!   if (block_stack == 0)
      return 0;
  
    if (this_contour && block_stack->data.block.cleanups != NULL)
--- 4333,4340 ----
  {
    struct nesting *block;
  
!   if (current_function == NULL || current_function->stmt == NULL
!       || block_stack == 0)
      return 0;
  
    if (this_contour && block_stack->data.block.cleanups != NULL)

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