]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCval.c
* src/SDCCast.c (processParams): added new type flow and restructured
[fw/sdcc] / src / SDCCval.c
index 0020b56c5723debdcffa2476c430a7500b5c22bb..a0d5e15c31b90aebdb88f2112aaf271fa3f8812e 100644 (file)
@@ -269,18 +269,27 @@ list2expr (initList * ilist)
 /* resolveIvalSym - resolve symbols in initial values               */
 /*------------------------------------------------------------------*/
 void
-resolveIvalSym (initList * ilist)
+resolveIvalSym (initList * ilist, sym_link * type)
 {
+  RESULT_TYPE resultType;
+
   if (!ilist)
     return;
 
   if (ilist->type == INIT_NODE)
-    ilist->init.node = decorateType (resolveSymbols (ilist->init.node), RESULT_CHECK);
+    {
+      if (IS_PTR (type))
+        resultType = RESULT_TYPE_NONE;
+      else
+        resultType = getResultTypeFromType (getSpec (type));
+      ilist->init.node = decorateType (resolveSymbols (ilist->init.node),
+                                      resultType);
+    }
 
   if (ilist->type == INIT_DEEP)
-    resolveIvalSym (ilist->init.deep);
+    resolveIvalSym (ilist->init.deep, type);
 
-  resolveIvalSym (ilist->next);
+  resolveIvalSym (ilist->next, type);
 }
 
 /*-----------------------------------------------------------------*/