Branch: Tag:

2017-03-20

2017-03-20 21:34:13 by Arne Goedeke <el@laramies.com>

Interpreter: use pike_pop_locals in low_return()

This reduces code duplication.

2207:    return NULL;   }    + static void pike_pop_locals(struct svalue *save_sp, ptrdiff_t n); +    void low_return(void)   {    struct svalue *save_sp = frame_get_save_sp(Pike_fp);
2246:    Pike_mark_sp=Pike_fp->save_mark_sp;    POP_PIKE_FRAME();    -  if (pop) -  pop_n_elems(Pike_sp-save_sp); -  else -  stack_pop_n_elems_keep_top (Pike_sp - save_sp - 1); +  pike_pop_locals(save_sp, !pop);    -  { -  /* consider using a flag for immediate destruct instead... */ -  extern struct object *objects_to_destruct; -  if( objects_to_destruct ) -  destruct_objects_to_destruct(); -  } -  +    #ifdef PIKE_DEBUG    if(save_sp+1 > Pike_sp && !pop)    Pike_fatal("Pike function did not leave a return value\n");
3472:       if (n) memmove(save_sp, save_sp+pop, n*sizeof(struct svalue));    +  { +  extern struct object *objects_to_destruct; +  if (UNLIKELY(objects_to_destruct))    low_destruct_objects_to_destruct();    } -  + }      PMOD_EXPORT void callsite_reset_pikecall(struct pike_callsite *c) {    struct pike_frame *frame;