diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-03-21 11:07:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 11:07:07 +0100 |
commit | 33a2c5def0f55ef67196e35ac3309d3f9b70d967 (patch) | |
tree | f6ce4ac65126f97a61ed67f1ba84af5044dd564b /modules/gdscript | |
parent | 9061d6f8ce8c393653204b7565d7af3fe0c3c084 (diff) | |
parent | 0664a9ef8efd88819aadbae776d706de5c3955f5 (diff) |
Merge pull request #8095 from RandomShaper/fix-yield-crash
Fix random crashes when using yield()
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_function.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index aaf97001e9..0e7ba981f4 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -189,7 +189,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(); |