aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xChangeLog5
-rw-r--r--TODO4
-rw-r--r--awkgram.c2
-rw-r--r--awkgram.y2
4 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a7a8de06..cb0a2cba 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-02-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (snode): Disallow @/.../ as second param of index, also.
+ * TODO: Updated.
+
2019-02-02 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.c, command.c: Regenerated with Bison 3.3.
diff --git a/TODO b/TODO
index b621ab6b..5f10b2b5 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-Wed Dec 12 21:29:16 IST 2018
+Sun Feb 3 20:34:46 IST 2019
============================
There were too many files tracking different thoughts and ideas for
@@ -41,6 +41,8 @@ Minor New Features
Consider relaxing the strictness of --posix.
+ Enhance --lint=invalid to apply in more places.
+
? Add an optional base to strtonum, allowing 2-36.
? Optional third argument for index indicating where to start the
diff --git a/awkgram.c b/awkgram.c
index 55c42dbd..2269c589 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -7293,7 +7293,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
else if (r->builtin == do_index) {
arg = subn->nexti->lasti->nexti; /* 2nd arg list */
ip = arg->lasti;
- if (ip->opcode == Op_match_rec)
+ if (ip->opcode == Op_match_rec || ip->opcode == Op_push_re)
fatal(_("index: regexp constant as second argument is not allowed"));
}
#ifdef ARRAYDEBUG
diff --git a/awkgram.y b/awkgram.y
index 415b894b..720efcee 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4799,7 +4799,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
else if (r->builtin == do_index) {
arg = subn->nexti->lasti->nexti; /* 2nd arg list */
ip = arg->lasti;
- if (ip->opcode == Op_match_rec)
+ if (ip->opcode == Op_match_rec || ip->opcode == Op_push_re)
fatal(_("index: regexp constant as second argument is not allowed"));
}
#ifdef ARRAYDEBUG