* src/SDCCpeeph.c (notVolatileVariable): extra check, somehow for hc08 an operand
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Oct 2007 15:47:22 +0000 (15:47 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Oct 2007 15:47:22 +0000 (15:47 +0000)
  can have isspilt==1 and spillLoc==NULL (?)

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4949 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCpeeph.c

index 0359d8946bf23d1622925f96d8f554a7395fc201..871ca6768d519e3dc632224f70bb0f54f576ffda 100644 (file)
@@ -821,7 +821,9 @@ notVolatileVariable(char *var, lineNode *currPl, lineNode *endPl)
             op = IC_COND (cl->ic);
             if (IS_SYMOP (op) &&
                 ( !strcmp(OP_SYMBOL (op)->rname, symname) ||
-                  (OP_SYMBOL (op)->isspilt && !strcmp(SPIL_LOC (op)->rname, symname)) ))
+                  (OP_SYMBOL (op)->isspilt &&
+                   SPIL_LOC (op) &&
+                   !strcmp(SPIL_LOC (op)->rname, symname)) ))
               {
                 return !op->isvolatile;
               }
@@ -829,7 +831,9 @@ notVolatileVariable(char *var, lineNode *currPl, lineNode *endPl)
             op = IC_JTCOND (cl->ic);
             if (IS_SYMOP (op) &&
                 ( !strcmp(OP_SYMBOL (op)->rname, symname) ||
-                  (OP_SYMBOL (op)->isspilt && !strcmp(SPIL_LOC (op)->rname, symname)) ))
+                  (OP_SYMBOL (op)->isspilt &&
+                   SPIL_LOC (op) &&
+                   !strcmp(SPIL_LOC (op)->rname, symname)) ))
               {
                 return !op->isvolatile;
               }
@@ -837,21 +841,27 @@ notVolatileVariable(char *var, lineNode *currPl, lineNode *endPl)
             op = IC_LEFT (cl->ic);
             if (IS_SYMOP (op) &&
                 ( !strcmp(OP_SYMBOL (op)->rname, symname) ||
-                  (OP_SYMBOL (op)->isspilt && !strcmp(SPIL_LOC (op)->rname, symname)) ))
+                  (OP_SYMBOL (op)->isspilt &&
+                   SPIL_LOC (op) &&
+                   !strcmp(SPIL_LOC (op)->rname, symname)) ))
               {
                 return !op->isvolatile;
               }
             op = IC_RIGHT (cl->ic);
             if (IS_SYMOP (op) &&
                 ( !strcmp(OP_SYMBOL (op)->rname, symname) ||
-                  (OP_SYMBOL (op)->isspilt && !strcmp(SPIL_LOC (op)->rname, symname)) ))
+                  (OP_SYMBOL (op)->isspilt &&
+                   SPIL_LOC (op) &&
+                   !strcmp(SPIL_LOC (op)->rname, symname)) ))
               {
                 return !op->isvolatile;
               }
             op = IC_RESULT (cl->ic);
             if (IS_SYMOP (op) &&
                 ( !strcmp(OP_SYMBOL (op)->rname, symname) ||
-                  (OP_SYMBOL (op)->isspilt && !strcmp(SPIL_LOC (op)->rname, symname)) ))
+                  (OP_SYMBOL (op)->isspilt &&
+                   SPIL_LOC (op) &&
+                   !strcmp(SPIL_LOC (op)->rname, symname)) ))
               {
                 return !op->isvolatile;
               }