fixed bug #522534
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 26 Feb 2002 09:07:23 +0000 (09:07 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 26 Feb 2002 09:07:23 +0000 (09:07 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1955 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/SDCCglue.c

index ea0a777a498fc085e726dcb19d2f26c62581b92a..e96afef1c9cc0d444bac4f1c466eb109e65f117c 100644 (file)
@@ -2148,8 +2148,10 @@ decorateType (ast * tree)
 
       if (IS_FUNC (LTYPE (tree)))
        {
-         werror (E_ILLEGAL_ADDR, "address of function");
-         goto errorTreeReturn;
+         // this ought to be ignored
+         return (tree->left);
+         //werror (E_ILLEGAL_ADDR, "address of function");
+         //goto errorTreeReturn;
        }
 
       if (IS_LITERAL(LTYPE(tree)))
index e8922ec841debb17375afbee0f9e0123c1fdff7f..9861c9855feb2a0eb3095f334d35cd047fe227fa 100644 (file)
@@ -796,6 +796,11 @@ printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
 
   val = list2val (ilist);
 
+  if (!val) {
+    // an error has been thrown allready
+    val=constVal("0");
+  }
+
   if (IS_LITERAL(val->etype)) {
     if (compareType(type,val->etype)==0) {
       werror (E_INCOMPAT_TYPES);