Branch: Tag:

2019-10-21

2019-10-21 09:44:47 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Improved robustness of pop_n_elems().

pop_n_elems() should now survive the stack being used during
the free_mixed_svalues() call. Fixes issue with destruct
callbacks being called during free_mixed_svalues().

Non-freed svalues were overwritten by the stack frame for the
destruct callbacks, and values freed by the destruct callbacks
were freed again, causing fatal error "Using unmarked freed svalue".

221:    if(x_) { \    struct svalue *_sp_; \    check__positive(x_, (msg_pop_neg, x_)); \ -  _sp_ = Pike_sp = Pike_sp - x_; \ -  debug_check_stack(); \ +  _sp_ = Pike_sp - x_; \    free_mixed_svalues(_sp_, x_); \ -  +  Pike_sp = _sp_; \ +  debug_check_stack(); \    } \    } while (0)