You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
` public struct Fixed64Vector3
{
public Fixed64 x;
public Fixed64 y;
public Fixed64 z;
public static readonly Fixed64Vector3 Zero3;
public Fixed64Vector3(int x, int y, int z)
{
this.x = new Fixed64(x);
this.y = new Fixed64(y);
this.z = new Fixed64(z);
}
static Fixed64Vector3()
{
Zero3 = new Fixed64Vector3(0, 0, 0);
}
}
public struct Fixed64
{
private long m_rawValue;
public static readonly Fixed64 Zero;
public Fixed64(long value)
{
m_rawValue = value;
}
static Fixed64()
{
Zero = new Fixed64(0);
}
}`
NullReferenceException: Object reference not set to an instance of an object
ILRuntime.Runtime.Intepreter.ILIntepreter.Execute (ILRuntime.CLR.Method.ILMethod method, ILRuntime.Runtime.Stack.StackObject* esp, System.Boolean& unhandledException) (at Assets/ILRuntime/Runtime/Intepreter/ILIntepreter.cs:2043)
Rethrow as ILRuntimeException: Object reference not set to an instance of an object
IL_0008: stsfld Numerics.FixedTest.Fixed64 Numerics.FixedTest.Fixed64::Zero
Numerics.FixedTest.Fixed64..cctor()
` public struct Fixed64Vector3
{
public Fixed64 x;
public Fixed64 y;
public Fixed64 z;
NullReferenceException: Object reference not set to an instance of an object
ILRuntime.Runtime.Intepreter.ILIntepreter.Execute (ILRuntime.CLR.Method.ILMethod method, ILRuntime.Runtime.Stack.StackObject* esp, System.Boolean& unhandledException) (at Assets/ILRuntime/Runtime/Intepreter/ILIntepreter.cs:2043)
Rethrow as ILRuntimeException: Object reference not set to an instance of an object
IL_0008: stsfld Numerics.FixedTest.Fixed64 Numerics.FixedTest.Fixed64::Zero
Numerics.FixedTest.Fixed64..cctor()
Fixed64类型InitializeFields下面这行代码执行中
staticInstance = new ILTypeStaticInstance(this)
由于.cctor中的这行指令
IL_0009: stsfld valuetype Numerics.FixedTest.Fixed64Vector3 Numerics.FixedTest.Fixed64Vector3::Zero
触发了 t.StaticInstance.AssignFromStack,但此时staticInstance为null。
Fixed64放到Fixed64Vector3之前就可避免异常,希望有帮助
The text was updated successfully, but these errors were encountered: