From: borutr Date: Thu, 14 Apr 2005 18:45:46 +0000 (+0000) Subject: * fixed bug 1045046 - SIGSEGV with really simple code?: X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=79d7c5b768f19fe5adce323d5d6574c415f0bf7a;p=fw%2Fsdcc * fixed bug 1045046 - SIGSEGV with really simple code?: src/pic16/pcode.c (pCodeInitRegisters)- pseudo stack size increased to 16 src/pic16/ralloc.c (typeRegWithIdx) - error message on pseudo stack overflow git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3739 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 95f99f2f..fe258f80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-04-14 Borut Razem + + * fixed bug 1045046 - SIGSEGV with really simple code?: + src/pic16/pcode.c (pCodeInitRegisters)- pseudo stack size increased to 16 + src/pic16/ralloc.c (typeRegWithIdx) - error message on pseudo stack overflow + 2005-04-14 Borut Razem * src/pic16/gen.c (genInline), src/pic16/main.c (_process_pragma), diff --git a/src/pic/pcode.c b/src/pic/pcode.c index 03d701b3..6da0b7dd 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -1344,7 +1344,8 @@ void pCodeInitRegisters(void) initialized = 1; shareBankAddress = 0x7f; /* FIXME - some PIC ICs like 16C7X which do not have a shared bank need a different approach. */ - stkSize = 8; // Set pseudo stack size to 8 +// stkSize = 8; // Set pseudo stack size to 8 + stkSize = 16; // Set pseudo stack size to 16 initStack(shareBankAddress, stkSize); // Putting the pseudo stack in shared memory so all modules use the same register when passing fn parameters init_pic(port->processor); if ((unsigned)shareBankAddress > getMaxRam()) diff --git a/src/pic/ralloc.c b/src/pic/ralloc.c index 44b0c500..18ab6fd5 100644 --- a/src/pic/ralloc.c +++ b/src/pic/ralloc.c @@ -970,6 +970,11 @@ typeRegWithIdx (int idx, int type, int fixed) debugLog ("Found a Stack Register!\n"); return dReg; } + else { + werror (E_STACK_OUT, "Register"); + /* return an existing register just to avoid the SDCC crash */ + return regWithIdx ( dynStackRegs, 0x7f, fixed); + } break; case REG_SFR: if( (dReg = regWithIdx ( dynProcessorRegs, idx, fixed)) != NULL ) {