registered ints can be casted to generic pointers
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 11 Jun 2001 16:35:34 +0000 (16:35 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 11 Jun 2001 16:35:34 +0000 (16:35 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@879 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/mcs51/gen.c

index b98844efb531338826c8e169c4792405d734672f..8a97a2ec59840c869a0cf93a546c53c161bbdd2b 100644 (file)
@@ -8179,8 +8179,13 @@ genCast (iCode * ic)
            p_type = DCL_TYPE (type);
          else
            {
-             /* we have to go by the storage class */
-             p_type = PTR_TYPE (SPEC_OCLS (etype));
+             if (SPEC_SCLS(etype)==S_REGISTER) {
+               // let's assume it is a generic pointer
+               p_type=GPOINTER;
+             } else {
+               /* we have to go by the storage class */
+               p_type = PTR_TYPE (SPEC_OCLS (etype));
+             }
            }
 
          /* the first two bytes are known */
@@ -8206,7 +8211,10 @@ genCast (iCode * ic)
            case CPOINTER:
              l = "#0x02";
              break;
-           case PPOINTER:
+           case GPOINTER:
+             l = "0x03";
+             break;
+           case PPOINTER: // what the fck is this?
              l = "#0x03";
              break;