1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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
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);