SCCS-vsn: usr.bin/pascal/src/call.c 1.18
* structure FUNCs look like
* (temp = p(...args...),&temp)
* formal FPROCs look like
* structure FUNCs look like
* (temp = p(...args...),&temp)
* formal FPROCs look like
- * ( t=p,( t -> entryaddr )(...args...,t),FRTN( t ))
+ * ( t=p,( t -> entryaddr )(...args...,t,s),FRTN(t,s))
* formal scalar FFUNCs look like
* formal scalar FFUNCs look like
- * ( t=p,temp=( t -> entryaddr )(...args...,t),FRTN( t ),temp)
+ * ( t=p,temp=( t -> entryaddr )(...args...,t,s),FRTN(t,s),temp)
* formal structure FFUNCs look like
* formal structure FFUNCs look like
- * (t=p,temp = ( t -> entryaddr )(...args...,t),FRTN( t ),&temp)
+ * (t=p,temp = ( t -> entryaddr )(...args...,t,s),FRTN(t,s),&temp)
*/
struct nl *
call(p, argv, porf, psbn)
*/
struct nl *
call(p, argv, porf, psbn)
int *r;
struct nl *p_type_class = classify( p -> type );
bool chk = TRUE;
int *r;
struct nl *p_type_class = classify( p -> type );
bool chk = TRUE;
+ struct nl *savedispnp; /* temporary to hold saved display */
# ifdef PC
long p_p2type = p2type( p );
long p_type_p2type = p2type( p -> type );
# ifdef PC
long p_p2type = p2type( p );
long p_type_p2type = p2type( p -> type );
struct nl *tempdescrp;
# endif PC
struct nl *tempdescrp;
# endif PC
+ if (p->class == FFUNC || p->class == FPROC) {
+ /*
+ * allocate space to save the display for formal calls
+ */
+ savedispnp = tmpalloc( sizeof display , NIL , NOREG );
+ }
# ifdef OBJ
if (p->class == FFUNC || p->class == FPROC) {
# ifdef OBJ
if (p->class == FFUNC || p->class == FPROC) {
+ put(2, O_LV | cbn << 8 + INDX ,
+ (int) savedispnp -> value[ NL_OFFS ] );
put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]);
}
if (porf == FUNC) {
put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]);
}
if (porf == FUNC) {
# ifdef OBJ
if ( p -> class == FFUNC || p -> class == FPROC ) {
put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]);
# ifdef OBJ
if ( p -> class == FFUNC || p -> class == FPROC ) {
put(2, PTR_RV | psbn << 8+INDX, (int)p->value[NL_OFFS]);
+ put(2, O_LV | cbn << 8 + INDX ,
+ (int) savedispnp -> value[ NL_OFFS ] );
put(1, O_FCALL);
put(2, O_FRTN, even(width(p->type)));
} else {
put(1, O_FCALL);
put(2, O_FRTN, even(width(p->type)));
} else {
putop( P2LISTOP , P2INT );
}
noarguments = FALSE;
putop( P2LISTOP , P2INT );
}
noarguments = FALSE;
+ putLV( 0 , cbn , savedispnp -> value[ NL_OFFS ] ,
+ savedispnp -> extra_flags , P2PTR | P2STRTY );
+ putop( P2LISTOP , P2INT );
}
/*
* do the actual call:
}
/*
* do the actual call:
"_FRTN" );
putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] ,
tempdescrp -> extra_flags , P2PTR | P2STRTY );
"_FRTN" );
putRV( 0 , cbn , tempdescrp -> value[ NL_OFFS ] ,
tempdescrp -> extra_flags , P2PTR | P2STRTY );
+ putLV( 0 , cbn , savedispnp -> value[ NL_OFFS ] ,
+ savedispnp -> extra_flags , P2PTR | P2STRTY );
+ putop( P2LISTOP , P2INT );
putop( P2CALL , P2INT );
putop( P2COMOP , P2INT );
}
putop( P2CALL , P2INT );
putop( P2COMOP , P2INT );
}