Fixed bug: temporary local was used more than once

This commit is contained in:
ceriel 1992-05-11 11:30:04 +00:00
parent f4cc095863
commit 2da0d6f886

View file

@ -336,6 +336,30 @@ WalkProcedure(procedure)
text_label = 1; /* label at end of procedure */ text_label = 1; /* label at end of procedure */
/* Check if we must save the stack pointer */
for (param = ParamList(procedure->df_type);
param;
param = param->par_next) {
if (! IsVarParam(param)) {
tp = TypeOfParam(param);
if ( IsConformantArray(tp)) {
/* First time we get here
*/
if (func_type && !too_big) {
/* Some local space, only
needed if the value itself
is returned
*/
retsav= TmpSpace(func_res_size, 1);
}
StackAdjustment = NewPtr();
C_lor((arith) 1);
STL(StackAdjustment, pointer_size);
}
}
}
#ifdef USE_INSERT #ifdef USE_INSERT
C_insertpart(partno); C_insertpart(partno);
#else #else
@ -400,20 +424,6 @@ WalkProcedure(procedure)
the stack adjusted, the return value pushed the stack adjusted, the return value pushed
again, and then RET again, and then RET
*/ */
if (! StackAdjustment) {
/* First time we get here
*/
if (func_type && !too_big) {
/* Some local space, only
needed if the value itself
is returned
*/
retsav= TmpSpace(func_res_size, 1);
}
StackAdjustment = NewPtr();
C_lor((arith) 1);
STL(StackAdjustment, pointer_size);
}
/* First compute new stackpointer */ /* First compute new stackpointer */
C_lal(param->par_def->var_off); C_lal(param->par_def->var_off);
CAL("new_stackptr", (int)pointer_size); CAL("new_stackptr", (int)pointer_size);