dotnet / dotnet/linker

Linker should not crash if method is marked as PInvokeImpl but doesn't have PInvokeInfo

Open
#1,527 0 comments 0 reactions 0 assignees View on GitHub
area-Linker: Steps
Dominant language
C#
Stars
392
Forks
128
Avg merge
2d 10h
Merged PRs (30d)
2

Description

It seems that some C++/CLI assemblies will have PInvoke methods without a row in the ImplMap table. Linker in this case crashes with null ref in https://github.com/mono/linker/blob/master/src/linker/Linker.Steps/MarkStep.cs#L2597
The `pii` is null in such a case.

Since we don't really use the `PInvokeInfo` for much (only when reporting imported modules really) - it should be safe to skip over this - maybe issue a warning?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.