Branch: Tag:

2015-12-08

2015-12-08 15:55:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Threads: Complain about attempts to start invalid thread functions.

Thanks to Stephen R. van den Berg <srb@cuci.nl> for the report.

Fixes [LysLysKOM 21546354].

1991:    (struct thread_state *)Pike_fp->current_storage;    int tmp;    +  if (args < 1) { +  SIMPLE_TOO_FEW_ARGS_ERROR("create", 1); +  } +  push_svalue(Pike_sp - args); +  f_callablep(1); +  if (UNSAFE_IS_ZERO(Pike_sp - 1)) { +  SIMPLE_BAD_ARG_ERROR("create", 1, "function"); +  } +  pop_stack(); +     if (thread_state->status != THREAD_NOT_STARTED) {    Pike_error("Threads can not be restarted (status:%d).\n",    thread_state->status);