Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Add type check to Address method on multidim arrays - #892

Merged
jkotas merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:arrayAddress
Feb 19, 2016
Merged

jkotas merged 1 commit into
dotnet:masterfrom
MichalStrehovsky:arrayAddress

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Fixes #89

MethodDesc getEETypePtr =
context.GetWellKnownType(WellKnownType.Object).GetKnownMethod("get_EETypePtr", null);
TypeDesc runtimeTypeHandleType = context.GetWellKnownType(WellKnownType.RuntimeTypeHandle);
MethodDesc getValueInternalMethod = runtimeTypeHandleType.GetKnownMethod("GetValueInternal", null);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use EETypePtrOf<T> here.

GetValueInternal intrinsic works today, but it is fragile because of it depends on IL pattern matching. I think it is likely that we will want to make EETypePtrOf recognized by the JIT as intrinsic at some point to fix this fragility (EETypePtrOf does not require IL pattern matching) and deprecate use of GetValueInternal.

@jkotas

jkotas commented Feb 19, 2016

Copy link
Copy Markdown
Member

LGTM otherwise

jkotas added a commit that referenced this pull request Feb 19, 2016
Add type check to Address method on multidim arrays
@jkotas
jkotas merged commit 5ef6706 into dotnet:master Feb 19, 2016
@MichalStrehovsky
MichalStrehovsky deleted the arrayAddress branch February 20, 2016 06:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants