Lokad / ILPack

Serialize .NET Core assemblies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EmitCalli - aware of any problems?

mf-RDP opened this issue · comments

Hi,

I'm on .NET 5.0, creating some Instructions with EmitCalli, e.g.
il.EmitCalli(OpCodes.Calli, CallingConventions.Standard, null, new Type[1] { typeof(double) }, null);

All were void, no varargs, parameter types primitive + some class.

It seems something gets broken in the code stream.

I can Invoke the dynamically created methods but after writing + reading the serialized assembly I get:

  • InvalidProgramExcn.
  • ILSpy cannot decompile the method. Some blob read errors, I did not yet debug this
    The latter happens only to the two methods (of some hundred) where I did Emit OpCodes.Calli

Many Thanks
Sascha

Hi @mf-RDP Thanks a lot for your follow-up. I am not aware of any problem specifically related to EmitCalli but absence of evidence is not evidence of absence. Unfortunately, I don't have the resources to attempt replicating your problem. However, the ILPack project contains already numerous unit tests. If you can manage to make a PR with a bit of code that replicates your problem, this would already go a long way to have it fixed. Closing for now, as I don't have really something actionable for you, but don't hesitate to re-open if you have some code to replicate the issue.

Ok. Thank you anyway.