Branch: Tag:

2019-10-28

2019-10-28 14:31:58 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Improved robustness of pop_n_elems() some more.

pop_n_elems() now uses pop_stack() to pop the elements.
This means that Pike_sp is kept consistent, and that no
svalues marked PIKE_T_UNKNOWN will show up on the valid
part of the stack.

Fixes fatal "Using unknown freed svalue."/PIKE-223 (#8223).

219:    do { \    ptrdiff_t x_=(X); \    if(x_) { \ -  struct svalue *_sp_; \ +     check__positive(x_, (msg_pop_neg, x_)); \ -  _sp_ = Pike_sp - x_; \ -  free_mixed_svalues(_sp_, x_); \ -  Pike_sp = _sp_; \ +  if (x_ > 131072) Pike_fatal("Popping too much!\n"); \ +  while (x_--) pop_stack(); \    debug_check_stack(); \    } \    } while (0)