fixed bug #475852
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Oct 2001 14:07:37 +0000 (14:07 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 29 Oct 2001 14:07:37 +0000 (14:07 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1463 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c

index aa9927106bcbbb29069f7ba8641f924a1a55cd5f..38b94995c38bb2d990905a3621c0f67a48be16b0 100644 (file)
@@ -2127,7 +2127,7 @@ decorateType (ast * tree)
       /* if bit field then error */
       if (IS_BITVAR (tree->left->etype))
        {
-         werror (E_ILLEGAL_ADDR, "addrress of bit variable");
+         werror (E_ILLEGAL_ADDR, "address of bit variable");
          goto errorTreeReturn;
        }
 
@@ -2143,7 +2143,13 @@ decorateType (ast * tree)
          goto errorTreeReturn;
        }
 
-      if (LRVAL (tree))
+      if (IS_LITERAL(LTYPE(tree)))
+       {
+         werror (E_ILLEGAL_ADDR, "address of literal");
+         goto errorTreeReturn;
+       }
+
+     if (LRVAL (tree))
        {
          werror (E_LVALUE_REQUIRED, "address of");
          goto errorTreeReturn;