shithub: scc

Download patch

ref: 877077e694f952576366f10435c058f26505e53a
parent: 214e7b3030b009afc4ec0085f098f5212909e91b
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Dec 27 08:25:21 EST 2017

[as] Create bytes with the size of the instruction

It is impossible to know the number of bytes that we have to copy, so the bytes
array must be always as big as the instruction size.

--- a/as/target/gen.awk
+++ b/as/target/gen.awk
@@ -56,7 +56,8 @@
 			       opsize[i], opformat[i]
 
 			if (opbytes[i] != "")
-				printf "\t\t.bytes = (unsigned char []) {%s},\n",
+				printf "\t\t.bytes = (unsigned char [%d]) {%s},\n",
+				        opsize[i],
 				        opbytes[i]
 
 			a = str2args(opargs[i])