shithub: scc

Download patch

ref: ee71aa8e400604c865f04db89601e2597da26ad5
parent: a43a8ede995f69063e33713f304d5ced7b5b3edb
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Aug 5 13:50:15 EDT 2014

Fix decay()

decay() generate a pointer from the name of a function or an array,
or in terms of types, a pointer to the type of the node of the
expression.

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -100,10 +100,7 @@
 static Node *
 decay(Node *np)
 {
-	Type *tp;
-
-	tp = mktype(np->type->type, PTR, 0);
-	return unarycode(OADDR, tp, np);
+	return unarycode(OADDR, mktype(np->type, PTR, NULL), np);
 }
 
 /*