X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic%2Fpcodepeep.c;h=f041796a8831bfe6c60219dff63b8ee535e0a84e;hb=3062f96ccb55d1d05caf9c8782f4961f87b341ce;hp=6c6c47205bbd4629a713997338cb6da3dfcf2482;hpb=195ee3f3ee25ce2c5f2a59fbd2779c4cb80527c3;p=fw%2Fsdcc diff --git a/src/pic/pcodepeep.c b/src/pic/pcodepeep.c index 6c6c4720..f041796a 100644 --- a/src/pic/pcodepeep.c +++ b/src/pic/pcodepeep.c @@ -28,12 +28,6 @@ #include "pcodeflow.h" #include "ralloc.h" -#if defined(__BORLANDC__) || defined(_MSC_VER) -#define STRCASECMP stricmp -#else -#define STRCASECMP strcasecmp -#endif - pCodeOp *popCopyGPR2Bit(pCodeOpReg *pc, int bitval); pCodeOp *popRegFromString(char *str, int size, int offset); @@ -2100,9 +2094,10 @@ int pCodePeepMatchRule(pCode *pc) /* We have just replaced the inefficient code with the rule. * Now, we need to re-add the C-source symbols if there are any */ pc = pcprev; - while(pc_cline ) { + while(pc && pc_cline ) { pc = findNextInstruction(pc->next); + if (!pc) break; PCI(pc)->cline = pc_cline; pc_cline = PCCS(pc_cline->pc.next); @@ -2111,13 +2106,14 @@ int pCodePeepMatchRule(pCode *pc) /* Copy C code comments to new code. */ pc = pcprev->next; if (pc) { - for (; pcout!=pcin; pcout=pcout->next) { + for (; pc && pcout!=pcin; pcout=pcout->next) { if (pcout->type==PC_OPCODE && PCI(pcout)->cline) { while (pc->type!=PC_OPCODE || PCI(pc)->cline) { pc = pc->next; if (!pc) break; } + if (!pc) break; PCI(pc)->cline = PCI(pcout)->cline; } }