Branch: Tag:

2017-04-27

2017-04-27 12:31:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Fixed NULL-dereference on error during init.

722:      PMOD_EXPORT void pike_threads_allow (struct thread_state *ts COMMA_DLOC_DECL)   { - #ifdef DO_PIKE_CLEANUP -  /* Might get here after th_cleanup() when reporting leaks. */ +  /* May get here after th_cleanup() when reporting leaks. */    if (!ts) return; - #endif +        if (UNLIKELY(thread_quanta > 0)) {    cpu_time_t now = get_real_time();
771:      PMOD_EXPORT void pike_threads_disallow (struct thread_state *ts COMMA_DLOC_DECL)   { - #ifdef DO_PIKE_CLEANUP +  /* May get here if early init code throws errors. */    if (!ts) return; - #endif +        if (ts->swapped) {    pike_lock_interpreter (DLOC_ARGS_OPT);