From: sandeep Date: Sun, 5 Nov 2000 19:54:25 +0000 (+0000) Subject: Fixed problem in SDCCalloc.h & fixed problem allocation X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=95deec14f7bdf848ef3a32c99f64ebc755eb7beb;p=fw%2Fsdcc Fixed problem in SDCCalloc.h & fixed problem allocation problem of static bit variables git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@487 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCalloc.h b/src/SDCCalloc.h index 2ffe5ec2..c0d71f83 100644 --- a/src/SDCCalloc.h +++ b/src/SDCCalloc.h @@ -4,7 +4,7 @@ #include "SDCCerr.h" -#ifdef OPT_DISABLE_GC +#if OPT_DISABLE_GC != 0 # include # define GC_malloc(x) calloc((x), 1) diff --git a/src/SDCCmem.c b/src/SDCCmem.c index 9a9cc209..3b47782f 100644 --- a/src/SDCCmem.c +++ b/src/SDCCmem.c @@ -263,8 +263,10 @@ void allocIntoSeg (symbol *sym) /*-----------------------------------------------------------------*/ void allocGlobal ( symbol *sym ) { + /* symbol name is internal name */ - sprintf (sym->rname,"%s%s", port->fun_prefix, sym->name); + if (!sym->level) /* local statics can come here */ + sprintf (sym->rname,"%s%s", port->fun_prefix, sym->name); /* add it to the operandKey reset */ addSet(&operKeyReset,sym); @@ -535,8 +537,7 @@ void allocLocal ( symbol *sym ) /* if this is a static variable */ if ( IS_STATIC (sym->etype)) { - SPEC_OCLS(sym->etype) = port->mem.default_local_map; - allocIntoSeg (sym); + allocGlobal(sym); sym->allocreq = 1; return ; }