Branch: Tag:

2019-11-02

2019-11-02 18:28:02 by Mateusz Krawczuk <krawczukmat@gmail.com>

Profiling: add safety check in interpreter's profiling code.

Apparently, it was pretty common for frame->context to be null,
which caused segfaults.

881: Inside #if defined(PROFILING)
   }   # endif /* PIKE_DEBUG */    Pike_interpreter.accounted_time += self_time; -  /* FIXME: Can context->prog be NULL? */ +  +  if (frame->context) {    function = frame->context->prog->identifiers + frame->ident;    if (!--function->recur_depth)    function->total_time += time_passed;    function->self_time += self_time; -  +  }   #endif /* PROFILING */       LOW_POP_PIKE_FRAME (frame);   }      #endif