diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2013-05-09 14:09:53 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2013-05-09 14:09:53 +0300 |
commit | f23270d71c3cdb85b79677f07378eac9e6bcafb5 (patch) | |
tree | 89be05f5275de3c01a8e92729b4bc04739c62f06 /awkgram.c | |
parent | 1ecf59325e466aed32ebfe71da3b7af8c15306cb (diff) | |
download | egawk-f23270d71c3cdb85b79677f07378eac9e6bcafb5.tar.gz egawk-f23270d71c3cdb85b79677f07378eac9e6bcafb5.tar.bz2 egawk-f23270d71c3cdb85b79677f07378eac9e6bcafb5.zip |
Make /regex/ a 2nd arg to index() a fatal error.
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |