shithub: scc

Download patch

ref: 4786cd4f6eca4565c5c0044871877682b378aa68
parent: a90c987aa4bf133d6b484e26684919f482ffad73
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Mar 18 10:42:11 EDT 2015

Fix addr2txt() bug

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

--- a/cc2/code.c
+++ b/cc2/code.c
@@ -139,7 +139,7 @@
 	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;