summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_disassembler.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-27 13:11:24 +0200
committerGitHub <noreply@github.com>2022-04-27 13:11:24 +0200
commitf626e8ef91d9f0c97c29ca04f2b240c4eae5214e (patch)
tree5feac7724f750feec7a673828ed943b580a5fd28 /modules/gdscript/gdscript_disassembler.cpp
parentadd51632246946f341c87e10c3ed3e8d660a6d94 (diff)
parent01d13ab2c16aa69a6f81c10dfe4845a50c3e0c63 (diff)
Merge pull request #60396 from vnen/gdscript-self-lambda
Diffstat (limited to 'modules/gdscript/gdscript_disassembler.cpp')
-rw-r--r--modules/gdscript/gdscript_disassembler.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_disassembler.cpp b/modules/gdscript/gdscript_disassembler.cpp
index 74090d0aa9..dc114f2eff 100644
--- a/modules/gdscript/gdscript_disassembler.cpp
+++ b/modules/gdscript/gdscript_disassembler.cpp
@@ -792,6 +792,25 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
incr = 3 + captures_count;
} break;
+ case OPCODE_CREATE_SELF_LAMBDA: {
+ int captures_count = _code_ptr[ip + 1 + instr_var_args];
+ GDScriptFunction *lambda = _lambdas_ptr[_code_ptr[ip + 2 + instr_var_args]];
+
+ text += DADDR(1 + captures_count);
+ text += "create self lambda from ";
+ text += lambda->name.operator String();
+ text += "function, captures (";
+
+ for (int i = 0; i < captures_count; i++) {
+ if (i > 0) {
+ text += ", ";
+ }
+ text += DADDR(1 + i);
+ }
+ text += ")";
+
+ incr = 3 + captures_count;
+ } break;
case OPCODE_JUMP: {
text += "jump ";
text += itos(_code_ptr[ip + 1]);