From 545a92196cf9e71b14b551427e8ab7ffbf8ea582 Mon Sep 17 00:00:00 2001 From: tecodev Date: Mon, 24 Jan 2005 00:18:44 +0000 Subject: [PATCH] * src/pic16/pcode.h: added second memory operand to pCodeOpReg to enable upcast to pCodeOpReg2 (there is no type tag to differenciate the two and pic16_popGet2p casts into PCOR2) * src/pic16/main.c (_process_pragma): fixed another malloc bug (sizeof(sectNames) changed to sizeof(sectName)) Both patches fix segfaults under MinGW. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3653 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 9 +++++++++ src/pic16/main.c | 2 +- src/pic16/pcode.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a8f0d5b3..8c365448 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-01-24 Raphael Neider + + * src/pic16/pcode.h: added second memory operand to pCodeOpReg + to enable upcast to pCodeOpReg2 (there is no type tag to + differenciate the two and pic16_popGet2p cast into PCOR2) + * src/pic16/main.c (_process_pragma): fixed another malloc bug + (sizeof(sectNames) changed to sizeof(sectName)) + Both patches fix segfaults under MinGW. + 2005-01-23 Raphael Neider * src/pic16/{device.c,pcode.c}: s/free/Safe_free/g for diff --git a/src/pic16/main.c b/src/pic16/main.c index 9d72e646..ac4e22e1 100644 --- a/src/pic16/main.c +++ b/src/pic16/main.c @@ -275,7 +275,7 @@ _process_pragma(const char *sz) } if(!found) { - snam = Safe_calloc(1, sizeof(sectNames)); + snam = Safe_calloc(1, sizeof(sectName)); snam->name = Safe_strdup( sectname ); snam->regsSet = NULL; diff --git a/src/pic16/pcode.h b/src/pic16/pcode.h index 73ba1f35..43657a5d 100644 --- a/src/pic16/pcode.h +++ b/src/pic16/pcode.h @@ -445,6 +445,8 @@ typedef struct pCodeOpReg struct regs *r; int instance; // byte # of Multi-byte registers struct pBlock *pb; + + pCodeOp *pcop2; // second memory operand (NEEDED IN gen.c:pic16_popGet2p (pCodeOpReg casted into pCodeOpReg2) } pCodeOpReg; typedef struct pCodeOpReg2 -- 2.47.2