モノでSystem.Reflection.Emit
でエクスポートされたアセンブリに変なバグがあります。 アセンブリを実行しようとすると、InvalidProgramException
が返されます。ILコードが無効です。InvalidProgramExceptionのヘルプ(無効なILコードですか?)
.method public static hidebysig
default void f_main (class [Pine.Core]Pine.Core.Function A_0, class [Pine.Core]Pine.Core.ValueList A_1) cil managed
{
// Method begins at RVA 0x2144
// Code size 26 (0x1a)
.maxstack 4
.locals init (
class [Pine.Core]Pine.Core.Function V_0,
class [Pine.Core]Pine.Core.IScope V_1,
class [Pine.Core]Pine.Core.ValueList V_2,
class [Pine.Core]Pine.Core.IScope V_3)
IL_0000: ldarg.0
IL_0001: stloc.0
IL_0002: ldarg.1
IL_0003: stloc.2
IL_0004: ldloc.0
IL_0005: ldftn instance class [Pine.Core]Pine.Core.IScope class [Pine.Core]Pine.Core.Function::get_Scope()
IL_000b: stloc.1
IL_000c: ldloc.1
IL_000d: newobj instance void class [Pine.Core]Pine.Core.BlockScope::'.ctor'(class [Pine.Core]Pine.Core.IScope)
IL_0012: stloc.3
IL_0013: ldloc.2
IL_0014: call instance void class [Pine.Core]Pine.Core.ValueList::Clear()
IL_0019: ret
} // end of method PineType::f_main
エラーは、私がなぜ分からない IL_000b: stloc.1
で起こる:
monodis
は私に(私はエミットでエクスポートするものと一致している)、このCIL結果を提供します。
stloc.1
をpop命令に置き換えようとしました。私がそうすると、エラーが発生しますIL_0019: ret
これはなぜこのように動作しているのかわかりません。何か案は?
追加情報:
IScope
はBlockScope
がIScope
Function
がpublic IScope Scope { get; private set; }
- が、私はモノ2.6.7(ベーム、AMD64)とMonoの両方で、このエラーを取得している実装インタフェースです2.8(Boehm型GCおよびパラレルマーク付き、AMD64)