diff options
author | ozan yigit <ozan.yigit@gmail.com> | 2023-12-28 14:51:49 -0500 |
---|---|---|
committer | ozan yigit <ozan.yigit@gmail.com> | 2023-12-28 14:51:49 -0500 |
commit | 04f69eaf0b99d6c0ca65115973830218ba8a2b72 (patch) | |
tree | 458ba321063709a1502b8a6c2220463c5b658b88 | |
parent | 08fa2b8c53138ee1162a2b9be78e192adcce26ec (diff) | |
download | one-true-awk-04f69eaf0b99d6c0ca65115973830218ba8a2b72.tar.gz |
test for matchop dereference bug
-rw-r--r-- | bugs-fixed/matchop-deref.awk | 11 | ||||
-rw-r--r-- | bugs-fixed/matchop-deref.bad | 2 | ||||
-rw-r--r-- | bugs-fixed/matchop-deref.in | 1 | ||||
-rw-r--r-- | bugs-fixed/matchop-deref.ok | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/bugs-fixed/matchop-deref.awk b/bugs-fixed/matchop-deref.awk new file mode 100644 index 0000000..6c066aa --- /dev/null +++ b/bugs-fixed/matchop-deref.awk @@ -0,0 +1,11 @@ +function foo() { + return "aaaaaab" +} + +BEGIN { + print match(foo(), "b") +} + +{ + print match(substr($0, 1), "b") +} diff --git a/bugs-fixed/matchop-deref.bad b/bugs-fixed/matchop-deref.bad new file mode 100644 index 0000000..343ee5c --- /dev/null +++ b/bugs-fixed/matchop-deref.bad @@ -0,0 +1,2 @@ +-1 +-1 diff --git a/bugs-fixed/matchop-deref.in b/bugs-fixed/matchop-deref.in new file mode 100644 index 0000000..0d197e1 --- /dev/null +++ b/bugs-fixed/matchop-deref.in @@ -0,0 +1 @@ +aaaaaab diff --git a/bugs-fixed/matchop-deref.ok b/bugs-fixed/matchop-deref.ok new file mode 100644 index 0000000..49019db --- /dev/null +++ b/bugs-fixed/matchop-deref.ok @@ -0,0 +1,2 @@ +7 +7 |