From 655b73782531b22f3871666e7624fa626ee80337 Mon Sep 17 00:00:00 2001 From: sandeep Date: Sun, 25 Feb 2001 00:32:02 +0000 Subject: [PATCH] fixed parms->ArgSym bug & type system bug git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@655 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCast.c | 2 +- src/SDCCast.h | 1 + src/SDCCsymt.c | 9 +++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/SDCCast.c b/src/SDCCast.c index 7c8885be..948d57de 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -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; diff --git a/src/SDCCast.h b/src/SDCCast.h index 735a6a93..5d306632 100644 --- a/src/SDCCast.h +++ b/src/SDCCast.h @@ -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 ) diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index e5fc5a66..2f1ba81a 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -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 */ /*-----------------------------------------------------------------*/ -- 2.30.2