aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y6
1 files changed, 6 insertions, 0 deletions
diff --git a/awkgram.y b/awkgram.y
index 0d86d4e1..68647229 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3985,6 +3985,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;