operand *right;
symbol *func = NULL;
int lineno = ic->lineno;
+ int bytesPushed=0;
ip = ic->next; /* insertion point */
/* remove it from the iCode */
{
newic = newiCode (IPUSH, right, NULL);
newic->parmPush = 1;
+ bytesPushed+=4;
}
addiCodeToeBBlock (ebp, newic, ip);
{
newic = newiCode (IPUSH, left, NULL);
newic->parmPush = 1;
+ bytesPushed+=4;
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
/* insert the call */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
- addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
+ newic->parmBytes+=bytesPushed;
+ addiCodeToeBBlock (ebp, newic, ip);
}
/*-----------------------------------------------------------------*/
int lineno = ic->lineno;
int bwd;
int su;
+ int bytesPushed=0;
+
remiCodeFromeBBlock (ebp, ic);
/* depending on the type */
{
newic = newiCode (IPUSH, IC_RIGHT (ic), NULL);
newic->parmPush = 1;
+ bytesPushed=getSize(type);
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
{
newic = newiCode (IPUSH, IC_LEFT (ic), NULL);
newic->parmPush = 1;
+ bytesPushed=getSize(type);
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
/* for the result */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
- addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
-
+ newic->parmBytes+=bytesPushed; // to clear the stack after the call
+ addiCodeToeBBlock (ebp, newic, ip);
}
/*-----------------------------------------------------------------*/