diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-14 17:17:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-14 17:17:00 +0200 |
commit | 47824992d4f97a6c0d4d07d5ff3f03ef37d8b3c2 (patch) | |
tree | 7667c50417a7f932ecd10a4cc314e6fe4025ed68 | |
parent | 551fb1c749f92d8797b11ac00477906af91e35ed (diff) | |
parent | d6ae7edd80b02571c90c35da0d796d1d7b9381b5 (diff) |
Merge pull request #49574 from Blackiris/fix-super-call-with-args
Fix "super" call when having at least one argument
-rw-r--r-- | modules/gdscript/gdscript_vm.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 318ec966ae..8a261a88e3 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -1989,7 +1989,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a ip += instr_arg_count; - int self_fun = _code_ptr[ip + 1]; + int argc = _code_ptr[ip + 1]; + GD_ERR_BREAK(argc < 0); + + int self_fun = _code_ptr[ip + 2]; #ifdef DEBUG_ENABLED if (self_fun < 0 || self_fun >= _global_names_count) { err_text = "compiler bug, function name not found"; @@ -1998,9 +2001,6 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #endif const StringName *methodname = &_global_names_ptr[self_fun]; - int argc = _code_ptr[ip + 2]; - GD_ERR_BREAK(argc < 0); - Variant **argptrs = instruction_args; GET_INSTRUCTION_ARG(dst, argc); |