Branch: Tag:

2019-08-18

2019-08-18 12:26:20 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Modified struct pike_frame.

The field save_sp_offset (which was an offset from locals) is replaced
by a proper pointer save_sp. This is in preparation to allow for the
locals pointer pointing somewhere else than the stack. This also fixes
a potential issue where the interpreter might crash on some cases of
very deep recursion.

2445:    fun += o->prog->inherits[SUBTYPEOF(*s)].identifier_level;    if((addr = lower_mega_apply(args-1, o, fun)))    { -  Pike_fp->save_sp_offset--; +  Pike_fp->save_sp--;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    DO_JUMP_TO(addr);    }
2503:    fun += o->prog->inherits[SUBTYPEOF(*s)].identifier_level;    if((addr = lower_mega_apply(args-1, o, fun)))    { -  Pike_fp->save_sp_offset--; +  Pike_fp->save_sp--;    Pike_fp->flags |=    PIKE_FRAME_RETURN_INTERNAL |    PIKE_FRAME_RETURN_POP;
2564:    fun += o->prog->inherits[SUBTYPEOF(*s)].identifier_level;    if((addr = lower_mega_apply(args-1, o, fun)))    { -  Pike_fp->save_sp_offset--; +  Pike_fp->save_sp--;    DO_IF_DEBUG(Pike_fp->next->pc=0);    unlink_previous_frame();    DO_JUMP_TO(addr);
2820:    addr += ENTRY_PROLOGUE_SIZE; \    \    new_frame->args = args; \ -  new_frame->locals=Pike_sp-args; \ -  new_frame->save_sp_offset = 0; \ +  new_frame->save_sp = new_frame->locals = Pike_sp - args; \    new_frame->save_mark_sp = Pike_mark_sp; \    DO_IF_DEBUG(new_frame->num_args=0;new_frame->num_locals=0;); \    SET_PROG_COUNTER(addr); \