scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 426818d5e07f09bdfe91272450dd2234f89f8096
parent ebdb4f888f8180ff7f937b9270cb003cb61bab7b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 17 Apr 2014 15:48:53 +0200

emit functions only when they are defined

The code was emiting functions all the times, even when they
where only declared.

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

diff --git a/decl.c b/decl.c @@ -498,11 +498,11 @@ extdecl(void) if (!(sclass & STATIC)) sym->s.isglobal = 1; if (BTYPE(tp) == FTN) { - emitfun(sym); if (yytoken == '{') { extern Symbol *curfun; curfun = sym; + emitfun(sym); emitsframe(sym); context(compound); emiteframe(sym); /* FIX: sym is not used */