From d84546d7a2584b6eaa71a9a83d05abc1624c8665 Mon Sep 17 00:00:00 2001 From: vrokas Date: Fri, 9 Jul 2004 23:35:21 +0000 Subject: [PATCH] * device/lib/pic16/libsdcc/float/ updated contents of all sources, * device/include/pic16/float.h: enabled prototypes of float support functions, * src/pic16/pcode.c: fixed bug #974733, nothing to do with _naked attribute though git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3379 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 2 ++ src/pic16/pcode.c | 27 ++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffd68eba..31156533 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6232,3 +6232,5 @@ * as/mcs51/aslink.h: accept everything as symbol name in rel-files, bug fix ID 452601 * as/mcs51/lklex.c: accept everything as symbol name in rel-files, bug fix ID 452601 * as/mcs51/lksym.c: accept everything as symbol name in rel-files, bug fix ID 452601 + +$Revision$ diff --git a/src/pic16/pcode.c b/src/pic16/pcode.c index 89491149..f2744b3b 100644 --- a/src/pic16/pcode.c +++ b/src/pic16/pcode.c @@ -3528,7 +3528,17 @@ static void destructpCodeFlow(pCode *pc) deleteSet(&PCFL(pc)->registers); deleteSet(&PCFL(pc)->from); deleteSet(&PCFL(pc)->to); - free(pc); + + /* Instead of deleting the memory used by this pCode, mark + * the object as bad so that if there's a pointer to this pCode + * dangling around somewhere then (hopefully) when the type is + * checked we'll catch it. + */ + + pc->type = PC_BAD; + pic16_addpCode2pBlock(pb_dead_pcodes, pc); + +// free(pc); } @@ -3671,7 +3681,16 @@ static void pCodeLabelDestruct(pCode *pc) if((pc->type == PC_LABEL) && PCL(pc)->label) free(PCL(pc)->label); - free(pc); + /* Instead of deleting the memory used by this pCode, mark + * the object as bad so that if there's a pointer to this pCode + * dangling around somewhere then (hopefully) when the type is + * checked we'll catch it. + */ + + pc->type = PC_BAD; + pic16_addpCode2pBlock(pb_dead_pcodes, pc); + +// free(pc); } @@ -4401,15 +4420,13 @@ static void genericDestruct(pCode *pc) */ pc->type = PC_BAD; - pic16_addpCode2pBlock(pb_dead_pcodes, pc); //free(pc); - } - +void DEBUGpic16_emitcode (char *inst,char *fmt, ...); /*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/ /* modifiers for constant immediate */ -- 2.47.2