2019-11-02
2019-11-02 18:28:02 by Mateusz Krawczuk <krawczukmat@gmail.com>
-
fa749c880d2d49cb22cb34ec6124cc3e4fc94257
(13 lines)
(+8/-5)
[
Show
| Annotate
]
Branch: master
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