aboutsummaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-12-08 21:20:11 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-12-08 21:20:11 +0200
commitc5da922b0486462028584e4568d6e00d1a4f2783 (patch)
treede1d17b273449e5aa03dcbf79d53edbc0bc3b157 /eval.c
parent69239a8fd65ad7f55cc2d567c933a800d5d10fac (diff)
parentd586094c7c4a9a412a7633a32d2b92a8e1cfea1c (diff)
downloadegawk-c5da922b0486462028584e4568d6e00d1a4f2783.tar.gz
egawk-c5da922b0486462028584e4568d6e00d1a4f2783.tar.bz2
egawk-c5da922b0486462028584e4568d6e00d1a4f2783.zip
Merge branch 'gawk-4.0-stable'
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 76c537e1..2a29eb9f 100644
--- a/eval.c
+++ b/eval.c
@@ -2626,7 +2626,7 @@ func_call:
break;
case Op_K_getline: /* no redirection */
- if (currule == BEGINFILE || currule == ENDFILE)
+ if (! currule || currule == BEGINFILE || currule == ENDFILE)
fatal(_("non-redirected `getline' invalid inside `%s' rule"),
ruletab[currule]);
@@ -2773,6 +2773,12 @@ func_call:
break;
case Op_K_exit:
+ /* exit not allowed in user-defined comparison functions for "sorted_in";
+ * This is done so that END blocks aren't executed more than once.
+ */
+ if (! currule)
+ fatal(_("`exit' cannot be called in the current context"));
+
exiting = TRUE;
POP_NUMBER(x1);
exit_val = (int) x1;