]> git.gag.com Git - fw/sdcc/commitdiff
fixed parms->ArgSym bug & type system bug
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 25 Feb 2001 00:32:02 +0000 (00:32 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 25 Feb 2001 00:32:02 +0000 (00:32 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@655 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/SDCCast.h
src/SDCCsymt.c

index 7c8885be1742d683dd440b7343d008c9ecb8dca7..948d57de2a296a7587caa6b05abde022e0e0400c 100644 (file)
@@ -1691,7 +1691,7 @@ reverseLoop (ast * loop, symbol * sym, ast * init, ast * end)
 void 
 pushTypeCastToLeaves (sym_link * type, ast * node, ast ** parentPtr)
 {
-  if (!node)
+  if (!node || IS_CALLOP(node))
     {
       /* WTF? We should never get here. */
       return;
index 735a6a937a7441b91203014955d56bb07983a424..5d306632893913cbce0be9104b2c1b4526a7bdf2 100644 (file)
@@ -111,6 +111,7 @@ ast;
 
 /* easy access macros   */
 #define  IS_AST_OP(x)                  (x && x->type == EX_OP)
+#define IS_CALLOP(x)   (IS_AST_OP(x) && x->opval.op == CALL)
 #define IS_BITOR(x) (IS_AST_OP(x) && x->opval.op == '|')
 #define IS_BITAND(x) (IS_AST_OP(x) && x->opval.op == '&' && \
                      x->left && x->right )
index e5fc5a66e7face3e94dca660fcd2dfa1d3a68741..2f1ba81a62160417e838af9daa66748cfddec5c8 100644 (file)
@@ -434,9 +434,10 @@ mergeSpec (sym_link * dest, sym_link * src)
   if (SPEC_NOUN (dest) != SPEC_NOUN (src) && !SPEC_NOUN (dest))
     SPEC_NOUN (dest) = SPEC_NOUN (src);
 
-  if (!SPEC_SCLS (dest))       /* if destination has no storage class */
+  /* if destination has no storage class */
+  if (!SPEC_SCLS (dest) || (SPEC_SCLS(dest) == S_CONSTANT && SPEC_SCLS (src)))
     SPEC_SCLS (dest) = SPEC_SCLS (src);
-
+  /* special case for const */
   /* copy all the specifications  */
   SPEC_LONG (dest) |= SPEC_LONG (src);
   SPEC_SHORT (dest) |= SPEC_SHORT (src);
@@ -1709,6 +1710,10 @@ isSymbolEqual (symbol * dest, symbol * src)
   return (!strcmp (dest->name, src->name));
 }
 
+void PT(sym_link *type)
+{
+       printTypeChain(type,0);
+}
 /*-----------------------------------------------------------------*/
 /* printTypeChain - prints the type chain in human readable form   */
 /*-----------------------------------------------------------------*/