* .version: Updated to 2.3.1
[fw/sdcc] / src / SDCCglue.c
index c86f5843a2bda19f2dbadfc11610508c6b15888d..d74a0f3bea06d25dc9d449303768cd12e470b5e7 100644 (file)
@@ -99,6 +99,11 @@ aopLiteralLong (value * val, int offset, int size)
        }
        fl;
 
+       if (!val) {
+         // assuming we have been warned before
+         val=constVal("0");
+       }
+
        /* if it is a float then it gets tricky */
        /* otherwise it is fairly simple */
        if (!IS_FLOAT (val->type)) {
@@ -181,6 +186,8 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag)
       /* if allocation required check is needed
          then check if the symbol really requires
          allocation only for local variables */
+      if (!sym->allocreq) continue;
+
       if (arFlag && !IS_AGGREGATE (sym->type) &&
          !(sym->_isparm && !IS_REGPARM (sym->etype)) &&
          !sym->allocreq && sym->level)
@@ -268,6 +275,7 @@ emitRegularMap (memmap * map, bool addPublics, bool arFlag)
            segment = SPEC_OCLS (symIval->etype);
            deleteSetItem (&segment->syms, symIval);
          }
+
          sym->ival = NULL;
        }
     }
@@ -377,7 +385,7 @@ initPointer (initList * ilist)
        }
  wrong:
        werror (W_INIT_WRONG);
-       return constVal("0");
+       return NULL;
 
 }
 
@@ -1565,11 +1573,3 @@ tempfile (void)
   return tmpfile ();
 }
 
-char *
-gc_strdup (const char *s)
-{
-  char *ret;
-  ret = Safe_calloc (1, strlen (s) + 1);
-  strcpy (ret, s);
-  return ret;
-}