shithub: scc

Download patch

ref: cf960fb35d42abc7516f45b87f246598796f476b
parent: 4bdc0861ffc9d96e34e0f5a84cb05deca769cfaf
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Dec 13 12:57:01 EST 2016

[cc1] Fix bug in field()

An anonymous struct had a NULL value in sym, not an
empty string.

--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -616,7 +616,7 @@
 {
 	static char *anon = "<anonymous>";
 	Symbol *sym = dcl->sym;
-	char *name = *sym->name ? sym->name : anon;
+	char *name = (sym->name) ? sym->name : anon;
 	Type *structp = dcl->parent, *tp = dcl->type;
 	TINT n = structp->n.elem;
 	int err = 0;