Skip to content

Commit f171d00

Browse files
committed
v2: Fix direct this->field accesses bypassing TDEF_FIELD dispatch
get_size(), get_fqn_hash(), and get_flags() on RETypeDefinition read fields directly via this->size / this->fqn_hash / this->type_flags, using the compiled-in tdb84 struct layout. For DMC5 (TDB 67), these fields are at different offsets in RETypeDefVersion67 — the direct access read garbage, causing get_size() to return 0 and the AutoGenerated Types section in ObjectExplorer to show nothing. Changed all three to use TDEF_FIELD(this, field) which dispatches to the correct version-specific struct at runtime. Verified: DMC5 AutoGenerated Types now discovers managed objects.
1 parent 4bc6530 commit f171d00

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

shared/sdk/RETypeDefinition.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,12 +978,12 @@ uint32_t RETypeDefinition::get_crc_hash() const {
978978
}
979979

980980
uint32_t RETypeDefinition::get_fqn_hash() const {
981-
return this->fqn_hash;
981+
return TDEF_FIELD(this, fqn_hash);
982982
}
983983

984984
uint32_t RETypeDefinition::get_size() const {
985985
#if TDB_VER > 49
986-
return this->size;
986+
return TDEF_FIELD(this, size);
987987
#else
988988
auto t = (regenny::via::typeinfo::TypeInfo*)get_type();
989989

@@ -1261,7 +1261,7 @@ ::REObjectInfo* RETypeDefinition::get_managed_vt() const {
12611261

12621262
uint32_t RETypeDefinition::get_flags() const {
12631263
#if TDB_VER > 49
1264-
return this->type_flags;
1264+
return TDEF_FIELD(this, type_flags);
12651265
#else
12661266
return 0;
12671267
#endif

0 commit comments

Comments
 (0)