From 06590a0f2e7a8144c7e2374b23f88b2fdd431418 Mon Sep 17 00:00:00 2001 From: johanknol Date: Wed, 19 Dec 2001 14:36:32 +0000 Subject: [PATCH] fixed bug #486483 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1716 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/pic/gen.c | 3 ++- src/z80/gen.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pic/gen.c b/src/pic/gen.c index 78091f79..c8a8fc64 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -8818,6 +8818,7 @@ static void genCast (iCode *ic) { operand *result = IC_RESULT(ic); sym_link *ctype = operandType(IC_LEFT(ic)); + sym_link *rtype = operandType(IC_RIGHT(ic)); operand *right = IC_RIGHT(ic); int size, offset ; @@ -9013,7 +9014,7 @@ static void genCast (iCode *ic) /* now depending on the sign of the destination */ size = AOP_SIZE(result) - AOP_SIZE(right); /* if unsigned or not an integral type */ - if (SPEC_USIGN(ctype) || !IS_SPEC(ctype)) { + if (SPEC_USIGN(rtype) || !IS_SPEC(rtype)) { while (size--) emitpcode(POC_CLRF, popGet(AOP(result),offset++)); } else { diff --git a/src/z80/gen.c b/src/z80/gen.c index 1ac58abf..b63138c0 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -6546,7 +6546,7 @@ static void genCast (iCode * ic) { operand *result = IC_RESULT (ic); - sym_link *ctype = operandType (IC_LEFT (ic)); + sym_link *rtype = operandType (IC_RIGHT (ic)); operand *right = IC_RIGHT (ic); int size, offset; @@ -6600,7 +6600,7 @@ genCast (iCode * ic) /* now depending on the sign of the destination */ size = AOP_SIZE (result) - AOP_SIZE (right); /* Unsigned or not an integral type - right fill with zeros */ - if (SPEC_USIGN (ctype) || !IS_SPEC (ctype)) + if (SPEC_USIGN (rtype) || !IS_SPEC (rtype) || AOP_TYPE(right)==AOP_CRY) { while (size--) aopPut (AOP (result), "!zero", offset++); -- 2.30.2