shithub: scc

Download patch

ref: b02b5fd160095f12c706e8b731bcc1feb6855d58
parent: fe1c4b0df744e9773a52356baaa91024c8e83e31
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Jul 1 14:37:00 EDT 2022

as: Use an addional array for ins list

We were using the array opstart to mark the opcodes that
already were parsed in mktbl.awk but it failed when the
opcode in position 0 had a repetition. To avoid this
problem is better to just use a new array.

--- a/src/cmd/as/mktbl.awk
+++ b/src/cmd/as/mktbl.awk
@@ -18,7 +18,8 @@
 /^$/		{next}
 
 		{
-		if (opstart[$1] == 0) {
+		if (op[$1] == 0) {
+			op[$1] = 1
 			opstart[$1] = nvar
 			opnames[nop++] = $1
 		}