summaryrefslogtreecommitdiff
path: root/awkgram.c
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/awkgram.c b/awkgram.c
index f6cc6de0..10fd4215 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -6533,6 +6533,12 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
ip->opcode = Op_push_array;
}
}
+ else if (r->builtin == do_index) {
+ arg = subn->nexti->lasti->nexti; /* 2nd arg list */
+ ip = arg->lasti;
+ if (ip->opcode == Op_match_rec)
+ fatal(_("index: regexp constant as second argument is not allowed"));
+ }
#ifdef ARRAYDEBUG
else if (r->builtin == do_adump) {
ip = subn->nexti->lasti;