Fix random crashes when using yield()

This commit is contained in:
Pedro J. Estébanez 2017-03-21 02:13:55 +01:00
parent 9c75b9dddf
commit 48da11372e
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
if (p_state) {
//use existing (supplied) state (yielded)
stack = (Variant *)p_state->stack.ptr();
call_args = (Variant **)stack + sizeof(Variant) * p_state->stack_size;
call_args = (Variant **)&p_state->stack.ptr()[sizeof(Variant) * p_state->stack_size]; //ptr() to avoid bounds check
line = p_state->line;
ip = p_state->ip;
alloca_size = p_state->stack.size();