aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-06-03 19:47:04 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-06-03 19:47:04 +0300
commit3d88a52ad1f67594f8c32c0e8c3f855dde8c6381 (patch)
tree38996926bfdb9df5c06a67818cfb18565531a66d /eval.c
parent5482bf19246965d6839fe9df1aec0785f0b1a329 (diff)
downloadegawk-3d88a52ad1f67594f8c32c0e8c3f855dde8c6381.tar.gz
egawk-3d88a52ad1f67594f8c32c0e8c3f855dde8c6381.tar.bz2
egawk-3d88a52ad1f67594f8c32c0e8c3f855dde8c6381.zip
Fix corner case use of exit.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 49659886..cf2264bf 100644
--- a/eval.c
+++ b/eval.c
@@ -1462,7 +1462,13 @@ unwind_stack(long n)
freenode(r);
break;
default:
- if (in_main_context())
+ /*
+ * Check `exiting' and don't produce an error for
+ * cases like:
+ * func _fn0() { exit }
+ * BEGIN { ARRAY[_fn0()] }
+ */
+ if (in_main_context() && ! exiting)
fatal(_("unwind_stack: unexpected type `%s'"),
nodetype2str(r->type));
/* else