From: johanknol Date: Tue, 25 Sep 2001 11:50:45 +0000 (+0000) Subject: a better constant to type check X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a1d455261601fcef9fb192efdafd1265cbf55067;p=fw%2Fsdcc a better constant to type check removed a temporary fix filed a bug report, stating the real problem git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1308 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 394d9e57..38c60a98 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -1859,30 +1859,19 @@ genCall (iCode * ic) sic = setNextItem (_G.sendSet)) { int size, offset = 0; - if (IS_VALOP(IC_LEFT(sic)) && IS_OP_LITERAL(IC_LEFT(sic)) - // PENDING: checkConstant2Type() - // do some range checking here, just bitvars for now - && IS_BITVAR(IC_LEFT(sic)->operand.valOperand->type)) { - if (floatFromVal(IC_LEFT(sic)->operand.valOperand)) { - emitcode ("mov", "%s,#0x01", fReturn[0]); - } else { - emitcode ("mov", "%s,#0x00", fReturn[0]); + aopOp (IC_LEFT (sic), sic, FALSE); + size = AOP_SIZE (IC_LEFT (sic)); + while (size--) + { + char *l = aopGet (AOP (IC_LEFT (sic)), offset, + FALSE, FALSE); + if (strcmp (l, fReturn[offset])) + emitcode ("mov", "%s,%s", + fReturn[offset], + l); + offset++; } - } else { - aopOp (IC_LEFT (sic), sic, FALSE); - size = AOP_SIZE (IC_LEFT (sic)); - while (size--) - { - char *l = aopGet (AOP (IC_LEFT (sic)), offset, - FALSE, FALSE); - if (strcmp (l, fReturn[offset])) - emitcode ("mov", "%s,%s", - fReturn[offset], - l); - offset++; - } - freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); - } + freeAsmop (IC_LEFT (sic), NULL, sic, TRUE); } _G.sendSet = NULL; }