X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCglue.c;h=55487f379a1f6eb8939a46db25137c7f9423230a;hb=3dbddca188862a21ed6a259449d1c96ca5ac351a;hp=115bf6622159754d6d0d4456c453bc77ed01e085;hpb=7131c95b14af27494c070111ef89a541889c3a79;p=fw%2Fsdcc diff --git a/src/SDCCglue.c b/src/SDCCglue.c index 115bf662..55487f37 100644 --- a/src/SDCCglue.c +++ b/src/SDCCglue.c @@ -70,7 +70,7 @@ DEFSETFUNC (rmTmpFiles) if (name) { unlink (name); - free (name); + Safe_free (name); } return 0; } @@ -204,7 +204,7 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag) (sym->_isparm && !IS_REGPARM (sym->etype))) && addPublics && !IS_STATIC (sym->etype) && - (IS_FUNC(sym->type) ? (sym->used || sym->fbody) : 1)) + (IS_FUNC(sym->type) ? (sym->used || IFFUNC_HASBODY(sym->type)) : 1)) { addSetHead (&publics, sym); } @@ -274,7 +274,8 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag) /* if the ival is a symbol assigned to an aggregate, (bug #458099 -> #462479) we don't need it anymore, so delete it from its segment */ - if (IS_AST_SYM_VALUE(sym->ival->init.node) && + if (sym->ival->type == INIT_NODE && + IS_AST_SYM_VALUE(sym->ival->init.node) && IS_AGGREGATE (sym->type) ) { symIval=AST_SYMBOL(sym->ival->init.node); segment = SPEC_OCLS (symIval->etype); @@ -1104,7 +1105,7 @@ createInterruptVect (FILE * vFile) } /* if the main is only a prototype ie. no body then do nothing */ - if (!mainf->fbody) + if (!IFFUNC_HASBODY(mainf->type)) { /* if ! compile only then main function should be present */ if (!options.cc_only && !noAssemble) @@ -1388,7 +1389,7 @@ glue () copyFile (asmFile, ovrFile); /* create the stack segment MOF */ - if (mainf && mainf->fbody) + if (mainf && IFFUNC_HASBODY(mainf->type)) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; Stack segment in internal ram \n"); @@ -1410,7 +1411,7 @@ glue () copyFile (asmFile, bit->oFile); /* if external stack then reserve space of it */ - if (mainf && mainf->fbody && options.useXstack) + if (mainf && IFFUNC_HASBODY(mainf->type) && options.useXstack) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; external stack \n"); @@ -1427,7 +1428,7 @@ glue () copyFile (asmFile, xdata->oFile); /* copy the interrupt vector table */ - if (mainf && mainf->fbody) + if (mainf && IFFUNC_HASBODY(mainf->type)) { fprintf (asmFile, "%s", iComments2); fprintf (asmFile, "; interrupt vector \n"); @@ -1450,7 +1451,7 @@ glue () tfprintf (asmFile, "\t!area\n", port->mem.post_static_name); tfprintf (asmFile, "\t!area\n", port->mem.static_name); - if (mainf && mainf->fbody) + if (mainf && IFFUNC_HASBODY(mainf->type)) { fprintf (asmFile, "__sdcc_gsinit_startup:\n"); /* if external stack is specified then the @@ -1485,7 +1486,7 @@ glue () } copyFile (asmFile, statsg->oFile); - if (port->general.glue_up_main && mainf && mainf->fbody) + if (port->general.glue_up_main && mainf && IFFUNC_HASBODY(mainf->type)) { /* This code is generated in the post-static area. * This area is guaranteed to follow the static area @@ -1507,7 +1508,7 @@ glue () fprintf (asmFile, "; code\n"); fprintf (asmFile, "%s", iComments2); tfprintf (asmFile, "\t!areacode\n", CODE_NAME); - if (mainf && mainf->fbody) + if (mainf && IFFUNC_HASBODY(mainf->type)) { /* entry point @ start of CSEG */ @@ -1589,7 +1590,7 @@ tempfile (void) tmpdir = getenv ("TMPDIR"); if (tmpdir) { - char *name = tempnam (tmpdir, "sdcc"); + char *name = Safe_strdup( tempnam (tmpdir, "sdcc")); if (name) { FILE *fp = fopen (name, "w+b");