X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCBBlock.c;h=fd50e6a3b00b08df5a1e1715180d402c8b413c2e;hb=7b0cd93b7bd04b332f409c2ece675f3943bbd70a;hp=9b809bed9cfbaca434bc1752508f9e7191917a96;hpb=9b6292c6f1828886ea5bacb609e63403823e3c06;p=fw%2Fsdcc diff --git a/src/SDCCBBlock.c b/src/SDCCBBlock.c index 9b809bed..fd50e6a3 100644 --- a/src/SDCCBBlock.c +++ b/src/SDCCBBlock.c @@ -102,8 +102,8 @@ FILE *appendDumpFile (int id) { if (!dumpFilesPtr->filePtr) { // not used before, create it - strcpy (scratchFileName, dstFileName); - strcat (scratchFileName, dumpFilesPtr->ext); + strncpyz (scratchFileName, dstFileName, PATH_MAX); + strncatz (scratchFileName, dumpFilesPtr->ext, PATH_MAX); if (!(dumpFilesPtr->filePtr = fopen (scratchFileName, "w"))) { werror (E_FILE_OPEN_ERR, scratchFileName); exit (1); @@ -188,9 +188,10 @@ dumpEbbsToFileExt (int id, eBBlock ** ebbs, int count) for (i = 0; i < count; i++) { fprintf (of, "\n----------------------------------------------------------------\n"); - fprintf (of, "Basic Block %s : loop Depth = %d noPath = %d , lastinLoop = %d\n", + fprintf (of, "Basic Block %s : loop Depth(lSeq) = %d(%d) noPath = %d , lastinLoop = %d\n", ebbs[i]->entryLabel->name, ebbs[i]->depth, + ebbs[i]->depth ? findLoopEndSeq(ebbs[i]->partOfLoop) : 0, ebbs[i]->noPath, ebbs[i]->isLastInLoop); fprintf (of, "\ndefines bitVector :"); @@ -226,7 +227,7 @@ iCode2eBBlock (iCode * ic) ebb->entryLabel = ic->argLabel.label; else { - sprintf (buffer, "_eBBlock%d", eBBNum++); + SNPRINTF (buffer, sizeof(buffer), "_eBBlock%d", eBBNum++); ebb->entryLabel = newSymbol (buffer, 1); ebb->entryLabel->key = labelKey++; } @@ -419,6 +420,7 @@ addiCodeToeBBlock (eBBlock * ebp, iCode * ic, iCode * ip) void remiCodeFromeBBlock (eBBlock * ebb, iCode * ic) { + wassert (ic->seq>=ebb->fSeq && ic->seq<=ebb->lSeq); if (ic->prev) ic->prev->next = ic->next; else