Cleaning up compiler warnings under MS VC6
[fw/sdcc] / src / SDCCpeeph.c
index dbcb3eb04a5bfa96581cc00a3c4907ce816f8345..fb207ff21767cc4380c8485e6882b243b3b1cc30 100644 (file)
@@ -709,7 +709,9 @@ replaceRule (lineNode ** shead, lineNode * stail, peepRule * pr)
 {
   lineNode *cl = NULL;
   lineNode *pl = NULL, *lhead = NULL;
-  char lb[MAX_PATTERN_LEN];
+  /* a long function name and long variable name can evaluate to
+     4x max pattern length e.g. "mov dptr,((fie_var>>8)<<8)+fie_var" */
+  char lb[MAX_PATTERN_LEN*4];
   char *lbp;
   lineNode *comment = NULL;
 
@@ -745,11 +747,13 @@ replaceRule (lineNode ** shead, lineNode * stail, peepRule * pr)
                  l++;
                  continue;
                }
-             while (*v)
+             while (*v) {
                *lbp++ = *v++;
+             }
              l++;
-             while (isdigit (*l))
+             while (isdigit (*l)) {
                l++;
+             }
              continue;
            }
          *lbp++ = *l++;
@@ -953,7 +957,6 @@ top:
 
       for (spl = *pls; spl; spl = spl->next)
        {
-
          /* if inline assembler then no peep hole */
          if (spl->isInline)
            continue;