scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 4786cd4f6eca4565c5c0044871877682b378aa68
parent a90c987aa4bf133d6b484e26684919f482ffad73
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 18 Mar 2015 14:42:11 +0000

Fix addr2txt() bug

printf() was expecting a char *, but we were passing a pointer to struct,
whose first member was a char *.

Diffstat:
Mcc2/code.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc2/code.c b/cc2/code.c @@ -139,7 +139,7 @@ addr2txt(char op, Addr *a) case MEM: sym = a->u.sym; if (sym->name) - printf((op == LDI) ? "%s" : "(%s)", sym); + printf((op == LDI) ? "%s" : "(%s)", sym->name); else printf((op == LDI) ? "T%u" : "(T%u)", sym->id); break;