GDScript: Add disassembling implicit and lambda functions

This commit is contained in:
Danil Alexeev 2024-11-26 14:50:06 +03:00
parent d09d82d433
commit a73573b093
No known key found for this signature in database
GPG key ID: 5A52F75A8679EC57
4 changed files with 77 additions and 36 deletions

View file

@ -362,7 +362,12 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
incr += 3;
} break;
case OPCODE_SET_STATIC_VARIABLE: {
Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
Ref<GDScript> gdscript;
if (_code_ptr[ip + 2] == ADDR_CLASS) {
gdscript = Ref<GDScript>(_script);
} else {
gdscript = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
}
text += "set_static_variable script(";
text += GDScript::debug_get_script_name(gdscript);
@ -378,7 +383,12 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
incr += 4;
} break;
case OPCODE_GET_STATIC_VARIABLE: {
Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
Ref<GDScript> gdscript;
if (_code_ptr[ip + 2] == ADDR_CLASS) {
gdscript = Ref<GDScript>(_script);
} else {
gdscript = get_constant(_code_ptr[ip + 2] & ADDR_MASK);
}
text += "get_static_variable ";
text += DADDR(1);