scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit f4b3100caf1e7eba3c63b00c9736903db2a30664
parent 050562adca2a8140db340bfe6f64bd06803f1aab
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 27 Dec 2017 13:25:21 +0000

[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.

Diffstat:
Mas/target/gen.awk | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/as/target/gen.awk b/as/target/gen.awk @@ -56,7 +56,8 @@ END { 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])