]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCBBlock.c
LRH commit, only to sync with other developers
[fw/sdcc] / src / SDCCBBlock.c
index 717b97cfd371a4d3a90646b6f0f579b9b2853fdb..dac9d8ec5ce3019245d2327fb0c88818da07628b 100644 (file)
@@ -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,11 @@ 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,
+              (0 /* for now */ &
+               ebbs[i]->depth) ? findLoopEndSeq(ebbs[i]->partOfLoop) : 0,
               ebbs[i]->noPath,
               ebbs[i]->isLastInLoop);
       fprintf (of, "\ndefines bitVector :");
@@ -226,7 +228,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++;
     }