* device/include/mcs51/compiler.h: new, added header file to enable
[fw/sdcc] / src / SDCCglue.c
index c803c0be0bcce0675f6a7b600725cc839598fe94..2e616548c66f7aab3bf1cfa19d44c0a485bf317f 100644 (file)
@@ -369,7 +369,7 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag)
         if (options.debug) {
           fprintf (map->oFile, "==.\n");
         }
-        if (IS_STATIC (sym->etype))
+          if (IS_STATIC (sym->etype) || sym->level)
           tfprintf (map->oFile, "!slabeldef\n", sym->rname);
         else
           tfprintf (map->oFile, "!labeldef\n", sym->rname);           
@@ -836,6 +836,7 @@ void
 printIvalArray (symbol * sym, sym_link * type, initList * ilist,
                 FILE * oFile)
 {
+  value *val;
   initList *iloop;
   unsigned int size = 0;
 
@@ -844,7 +845,12 @@ printIvalArray (symbol * sym, sym_link * type, initList * ilist,
     /* array of characters can be init  */
     /* by a string                      */
     if (IS_CHAR (type->next)) {
-      if (!IS_LITERAL(list2val(ilist)->etype)) {
+      val = list2val(ilist);
+      if (!val) {
+        werrorfl (ilist->filename, ilist->lineno, E_INIT_STRUCT, sym->name);
+        return;
+      }
+      if (!IS_LITERAL(val->etype)) {
         werrorfl (ilist->filename, ilist->lineno, E_CONST_EXPECTED);
         return;
       }