我试图理解为什么这是无效的IL代码和/或什么会导致这个错误。
抛出的异常是:
System.InvalidProgramException:中的IL代码无效 away3d.containers.View3D:updateBackBuffer():IL_0023:brfalse
IL_00ba
我使用monodis
和正在调用的方法(updateBackBuffer)进行反汇编并抛出错误如下,但我无法发现branch if false
语句或其周围的IL有什么问题:< / p>
// method line 841
.method family virtual hidebysig newslot
instance default void updateBackBuffer () cil managed
{
// Method begins at RVA 0x1e4d4
// Code size 226 (0xe2)
.maxstack 5
IL_0000: nop
IL_0001: ldarg.0
IL_0002: ldfld class away3d.core.managers.Stage3DProxy away3d.containers.View3D::_stage3DProxy
IL_0007: callvirt instance class [pscorlib_monomac]flash.display3D.Context3D class away3d.core.managers.Stage3DProxy::get_context3D()
IL_000c: brfalse IL_00e1
IL_0011: ldarg.0
IL_0012: ldfld bool away3d.containers.View3D::_shareContext
IL_0017: brtrue IL_00e1
IL_001c: nop
IL_001d: ldarg.0
IL_001e: ldfld float64 away3d.containers.View3D::_width
IL_0023: brfalse IL_00ba
IL_0028: ldarg.0
IL_0029: ldfld float64 away3d.containers.View3D::_height
IL_002e: brfalse IL_00ba
IL_0033: nop
IL_0034: ldarg.0
IL_0035: ldfld class away3d.core.managers.Stage3DProxy away3d.containers.View3D::_stage3DProxy
IL_003a: callvirt instance bool class away3d.core.managers.Stage3DProxy::get_usesSoftwareRendering()
IL_003f: brfalse IL_008c
IL_0044: nop
IL_0045: ldarg.0
IL_0046: ldfld float64 away3d.containers.View3D::_width
IL_004b: ldc.r8 2048.
IL_0054: ble.un IL_0068
IL_0059: ldarg.0
IL_005a: ldc.r8 2048.
IL_0063: stfld float64 away3d.containers.View3D::_width
IL_0068: ldarg.0
IL_0069: ldfld float64 away3d.containers.View3D::_height
IL_006e: ldc.r8 2048.
IL_0077: ble.un IL_008b
IL_007c: ldarg.0
IL_007d: ldc.r8 2048.
IL_0086: stfld float64 away3d.containers.View3D::_height
IL_008b: nop
IL_008c: ldarg.0
IL_008d: ldfld class away3d.core.managers.Stage3DProxy away3d.containers.View3D::_stage3DProxy
IL_0092: ldarg.0
IL_0093: ldfld float64 away3d.containers.View3D::_width
IL_0098: conv.i4
IL_0099: ldarg.0
IL_009a: ldfld float64 away3d.containers.View3D::_height
IL_009f: conv.i4
IL_00a0: ldarg.0
IL_00a1: ldfld unsigned int32 away3d.containers.View3D::_antiAlias
IL_00a6: conv.i4
IL_00a7: ldc.i4.1
IL_00a8: callvirt instance void class away3d.core.managers.Stage3DProxy::configureBackBuffer(int32, int32, int32, bool)
IL_00ad: ldarg.0
IL_00ae: ldc.i4.0
IL_00af: stfld bool away3d.containers.View3D::_backBufferInvalid
IL_00b4: nop
IL_00b5: br IL_00e0
IL_00ba: nop
IL_00bb: ldarg.0
IL_00bc: ldarg.0
IL_00bd: callvirt instance class [pscorlib_monomac]flash.display.Stage class [pscorlib_monomac]flash.display.DisplayObject::get_stage()
IL_00c2: callvirt instance int32 class [pscorlib_monomac]flash.display.Stage::get_stageWidth()
IL_00c7: conv.r8
IL_00c8: callvirt instance void class [pscorlib_monomac]flash.display.DisplayObject::set_width(float64)
IL_00cd: ldarg.0
IL_00ce: ldarg.0
IL_00cf: callvirt instance class [pscorlib_monomac]flash.display.Stage class [pscorlib_monomac]flash.display.DisplayObject::get_stage()
IL_00d4: callvirt instance int32 class [pscorlib_monomac]flash.display.Stage::get_stageHeight()
IL_00d9: conv.r8
IL_00da: callvirt instance void class [pscorlib_monomac]flash.display.DisplayObject::set_height(float64)
IL_00df: nop
IL_00e0: nop
IL_00e1: ret
} // end of method View3D::updateBackBuffer
答案 0 :(得分:1)
也许是因为那个地方的加载值不是布尔值?