]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stmt.c (start_cleanup_deferal, [...]): Test block_stack before dereferencing it.
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 20 Aug 1997 19:30:36 +0000 (12:30 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 20 Aug 1997 19:30:36 +0000 (12:30 -0700)
* stmt.c (start_cleanup_deferal, end_cleanup_deferal): Test
block_stack before dereferencing it.

From-SVN: r14861

gcc/ChangeLog
gcc/stmt.c

index 7f46b20ec4664d2c5ba3a9228df6c741b6dd7fe9..d34368c9464966b0aef6131cea9e2277cfa7e3b8 100644 (file)
@@ -1,4 +1,9 @@
-Wed Aug 20 14:57:11 1997  Michael Meissner  <meissner@cygnus.com>
+Wed Aug 20 11:58:33 1997  Jim Wilson  <wilson@cygnus.com>
+
+       * stmt.c (start_cleanup_deferal, end_cleanup_deferal): Test
+       block_stack before dereferencing it.
+
+Wed Aug 20 11:57:11 1997  Michael Meissner  <meissner@cygnus.com>
 
        * rs6000.h (ISSUE_RATE): Define instead of MACHINE_issue_rate.
 
index dcc5fa331feeb1f403d9f8aef7fc504dd9c9ae47..bc1e6ba6dd22f594da3586251ababa824634828a 100644 (file)
@@ -4212,7 +4212,10 @@ expand_cleanups (list, dont_do, in_fixup, reachable)
 void
 start_cleanup_deferal ()
 {
-  ++block_stack->data.block.conditional_code;
+  /* block_stack can be NULL if we are inside the parameter list.  It is
+     OK to do nothing, because cleanups aren't possible here.  */
+  if (block_stack)
+    ++block_stack->data.block.conditional_code;
 }
 
 /* Mark the end of a conditional region of code.  Because cleanup
@@ -4223,7 +4226,10 @@ start_cleanup_deferal ()
 void
 end_cleanup_deferal ()
 {
-  --block_stack->data.block.conditional_code;
+  /* block_stack can be NULL if we are inside the parameter list.  It is
+     OK to do nothing, because cleanups aren't possible here.  */
+  if (block_stack)
+    --block_stack->data.block.conditional_code;
 }
 
 /* Move all cleanups from the current block_stack