You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2867 added caching for type metadata. Type metadata pointers will come from two sources, ISwiftObject.GetTypeMetadata() and internal storage (for primitives). It might happen that ISwiftObject.GetTypeMetadata() returns a IntPtr.Zero (e.g. current implementation of AnyType). This is not a valid TypeMetadata and we should fail and produce a meaningful error on receiving it. Otherwise the program might fail without any meaningful message on pinvoke call.
In #2958 I added safeguards around static accessors to fail when TypeMetadata is invalid, however caching happens before the check. On following reads of the feral TypeMetadata the incorrect value is returned silently.
We should refactor the caching mechanism to ensure that only valid values are cached.
The text was updated successfully, but these errors were encountered:
#2867 added caching for type metadata. Type metadata pointers will come from two sources,
ISwiftObject.GetTypeMetadata()
and internal storage (for primitives). It might happen thatISwiftObject.GetTypeMetadata()
returns aIntPtr.Zero
(e.g. current implementation ofAnyType
). This is not a validTypeMetadata
and we should fail and produce a meaningful error on receiving it. Otherwise the program might fail without any meaningful message on pinvoke call.In #2958 I added safeguards around static accessors to fail when
TypeMetadata
is invalid, however caching happens before the check. On following reads of the feralTypeMetadata
the incorrect value is returned silently.We should refactor the caching mechanism to ensure that only valid values are cached.
The text was updated successfully, but these errors were encountered: