mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-01 01:29:28 +00:00
WIP: make variable types in simulate_unbind match OP_unbind
This commit is contained in:
36
src/mvs.c
36
src/mvs.c
@@ -69,6 +69,8 @@ newframe:
|
||||
fnhead = (struct fnhead *)FuncObj;
|
||||
pc = (ByteCode *)PC + 3; /* to skip the miscn opcode we're in now */
|
||||
} else {
|
||||
unbind_count = 0; /* different frame */
|
||||
|
||||
fnhead = (struct fnhead *)Addr68k_from_LADDR(POINTERMASK & SWA_FNHEAD((int)caller->fnheader));
|
||||
pc = (ByteCode *)fnhead + (caller->pc);
|
||||
}
|
||||
@@ -271,23 +273,25 @@ LispPTR make_value_list(int argcount, LispPTR *argarray) {
|
||||
|
||||
void simulate_unbind(FX2 *frame, int unbind_count, FX2 *returner) {
|
||||
int unbind;
|
||||
LispPTR *stackptr = (LispPTR *)(Stackspace + frame->nextblock);
|
||||
LispPTR *stack_pointer = (LispPTR *)(Stackspace + frame->nextblock);
|
||||
for (unbind = 0; unbind < unbind_count; unbind++) {
|
||||
register int value;
|
||||
register LispPTR *lastpvar;
|
||||
int bindnvalues;
|
||||
for (; ((int)*--stackptr >= 0);)
|
||||
; /* find the binding mark */
|
||||
value = (int)*stackptr;
|
||||
lastpvar = (LispPTR *)((DLword *)frame + FRAMESIZE + 2 + GetLoWord(value));
|
||||
;
|
||||
bindnvalues = (~value) >> 16;
|
||||
for (value = bindnvalues; --value >= 0;) { *--lastpvar = 0xffffffff; }
|
||||
/* This line caused \NSMAIL.READ.HEADING to smash memory, */
|
||||
/* so I removed it 21 Jul 91 --JDS. This was the only */
|
||||
/* difference between this function and the UNWIND code */
|
||||
/* in inlineC.h */
|
||||
/* MAKEFREEBLOCK(stackptr, (DLword *)stackptr-nextblock); */
|
||||
register LispPTR value;
|
||||
register LispPTR *ppvar;
|
||||
register DLword num;
|
||||
register DLword i;
|
||||
|
||||
/* now, stack_pointer points the latter part in slot */
|
||||
for (; !(*--stack_pointer & 0x80000000);)
|
||||
; /* scan (until MSB == 1) */
|
||||
|
||||
value = *stack_pointer;
|
||||
num = (DLword) ~(value >> 16);
|
||||
ppvar = (LispPTR *)((DLword *)frame + FRAMESIZE + 2 + GetLoWord(value));
|
||||
|
||||
value = 0xffffffff;
|
||||
for (i = 0; i < num; i++) { *--ppvar = value; }
|
||||
|
||||
/* MAKEFREEBLOCK(stack_pointer, (DLword *)stack_pointer-nextblock); */
|
||||
}
|
||||
if (returner)
|
||||
returner->fast = 0; /* since we've destroyed contiguity */
|
||||
|
||||
Reference in New Issue
Block a user