diff options
| author | Rémi Verschelde | 2017-03-21 11:07:34 +0100 |
|---|---|---|
| committer | GitHub | 2017-03-21 11:07:34 +0100 |
| commit | a14ad02d155da315b247c03337d98e151b504c61 (patch) | |
| tree | fe5c9c788c4c41a6ea2d93a2a403f715fbd28a83 /modules/gdscript | |
| parent | 9c75b9dddf18abf315f62caa6745daa05d4adbaf (diff) | |
| parent | 48da11372edd481d04b7009785c0609139179c49 (diff) | |
| download | godot-a14ad02d155da315b247c03337d98e151b504c61.tar.gz godot-a14ad02d155da315b247c03337d98e151b504c61.tar.zst godot-a14ad02d155da315b247c03337d98e151b504c61.zip | |
Merge pull request #8094 from RandomShaper/fix-yield-crash-2.1
Fix random crashes when using yield() (2.1)
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 638c28c4e..91c547806 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -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(); |
