This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch for bootstrap problem compiling tinfo.cc
- To: gcc-patches at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Subject: Patch for bootstrap problem compiling tinfo.cc
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Sat, 18 Sep 1999 14:03:53 +0100
- Cc: richard dot earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
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)