GDScript: Adjust type of temporaries when needed

This commit is contained in:
George Marques 2021-04-16 12:04:08 -03:00
parent 40502a1689
commit 9411bf05a4
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
6 changed files with 286 additions and 8 deletions

View file

@ -894,6 +894,51 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
incr += 2;
} break;
#define DISASSEMBLE_TYPE_ADJUST(m_v_type) \
case OPCODE_TYPE_ADJUST_##m_v_type: { \
text += "type adjust ("; \
text += #m_v_type; \
text += ") "; \
text += DADDR(1); \
incr += 2; \
} break
DISASSEMBLE_TYPE_ADJUST(BOOL);
DISASSEMBLE_TYPE_ADJUST(INT);
DISASSEMBLE_TYPE_ADJUST(FLOAT);
DISASSEMBLE_TYPE_ADJUST(STRING);
DISASSEMBLE_TYPE_ADJUST(VECTOR2);
DISASSEMBLE_TYPE_ADJUST(VECTOR2I);
DISASSEMBLE_TYPE_ADJUST(RECT2);
DISASSEMBLE_TYPE_ADJUST(RECT2I);
DISASSEMBLE_TYPE_ADJUST(VECTOR3);
DISASSEMBLE_TYPE_ADJUST(VECTOR3I);
DISASSEMBLE_TYPE_ADJUST(TRANSFORM2D);
DISASSEMBLE_TYPE_ADJUST(PLANE);
DISASSEMBLE_TYPE_ADJUST(QUAT);
DISASSEMBLE_TYPE_ADJUST(AABB);
DISASSEMBLE_TYPE_ADJUST(BASIS);
DISASSEMBLE_TYPE_ADJUST(TRANSFORM);
DISASSEMBLE_TYPE_ADJUST(COLOR);
DISASSEMBLE_TYPE_ADJUST(STRING_NAME);
DISASSEMBLE_TYPE_ADJUST(NODE_PATH);
DISASSEMBLE_TYPE_ADJUST(RID);
DISASSEMBLE_TYPE_ADJUST(OBJECT);
DISASSEMBLE_TYPE_ADJUST(CALLABLE);
DISASSEMBLE_TYPE_ADJUST(SIGNAL);
DISASSEMBLE_TYPE_ADJUST(DICTIONARY);
DISASSEMBLE_TYPE_ADJUST(ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_BYTE_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_INT32_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_INT64_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_FLOAT32_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_FLOAT64_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_STRING_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_VECTOR2_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_VECTOR3_ARRAY);
DISASSEMBLE_TYPE_ADJUST(PACKED_COLOR_ARRAY);
case OPCODE_ASSERT: {
text += "assert (";
text += DADDR(1);