Skip to content

Scan intrinsic methods if we're taking address - #103109

Merged
jkotas merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:dontskip
Jun 6, 2024
Merged

jkotas merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:dontskip

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

These can be address taken and if they are, we still need to scan them. Fixes pri-0 outerloop test build break.

Cc @dotnet/ilc-contrib

These can be address taken and if they are, we need to scan them.
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jkotas jkotas left a comment

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.

Good catch

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

These can be address taken and if they are, we still need to scan them.

Why aren't the other functions needed in this case? What does the scanner do that makes this fail?

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Why aren't the other functions needed in this case? What does the scanner do that makes this fail?

It would fail if we address take the other intrinsics above. But those are private to corelib and scanner implementation is not the only problem if we take their address. (The method body is going to throw when called indirectly.)

[Intrinsic]
private static IntPtr DefaultConstructorOf<T>()
{
// Codegens must expand this intrinsic to the pointer to the default constructor of T
// or to a marker that lets us detect there's no default constructor.
// We could implement a fallback with the type loader if we wanted to, but it will be slow and unreliable.
throw new NotSupportedException();
}
[Intrinsic]
private static IntPtr AllocatorOf<T>()
{
// Codegens must expand this intrinsic to the pointer to the allocator suitable to allocate an instance of T.
// We could implement a fallback with the type loader if we wanted to, but it will be slow and unreliable.
throw new NotSupportedException();
}

@MichalStrehovsky
MichalStrehovsky deleted the dontskip branch June 6, 2024 20:06
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2024
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