From ea975fc3904cc210ae470198b995d1bf270be3a3 Mon Sep 17 00:00:00 2001 From: wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 20 Aug 1997 19:30:36 +0000 Subject: [PATCH] * stmt.c (start_cleanup_deferal, end_cleanup_deferal): Test block_stack before dereferencing it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14861 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 ++++++- gcc/stmt.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7f46b20ec466..d34368c94649 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/stmt.c b/gcc/stmt.c index dcc5fa331fee..bc1e6ba6dd22 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -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 -- GitLab