Lokad / ILPack

Serialize .NET Core assemblies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tokens in inline IL signatures not mapped to new assembly

toptensoftware opened this issue · comments

Inline signatures might contain tokens that need to be converted to tokens for the new assembly's metadata.

metadata.ILBuilder.WriteBytes((byte[]) il[i].Operand);

btw: I wouldn't stress too much about this. The only instruction that uses this is calli and trying to find examples of it in netcore is really difficult. I just did a ildasm/grep across the entire netcore system dlls directory and couldn't find a single example. Windows .NET framework on the other hand has many instances of it.

Also, Roslyn doesn't appear to use Calli at all:

https://source.roslyn.codeplex.com/#System.Reflection.Metadata/System/Reflection/Metadata/IL/ILOpCode.cs,6929573abac8b4ca,references

Compared to Call which it does:

https://source.roslyn.codeplex.com/#System.Reflection.Metadata/System/Reflection/Metadata/IL/ILOpCode.cs,afdbfd5012ccde5c,references

@vermorel Can we postpone this issue for now? The calli OpCode is used now by Roslyn mostly for the native interop and we have to proceed with this case correctly (with rewriting the signature using proper arguments' types tokens) but it's not as easy as I've thought before.

@OlegRa No problem to postpone.