From 4a4a6943828afcdcc661bddcc59521a9bbbbc01c Mon Sep 17 00:00:00 2001 From: "[liaoqiang]" Date: Wed, 20 May 2020 16:27:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=B1=BB=E5=AF=B9=E8=B1=A1=E5=8F=AF=E6=AD=A3=E5=B8=B8=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E7=B1=BB=E6=88=90=E5=91=98=E5=87=BD=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99=E4=BF=A1=E6=81=AF=E5=AE=B9?= =?UTF-8?q?=E6=98=93=E5=BC=95=E8=B5=B7=E9=94=99=E8=AF=AF=E7=9A=84=E7=90=86?= =?UTF-8?q?=E8=A7=A3=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ILRuntime/Runtime/Intepreter/ILIntepreter.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ILRuntime/Runtime/Intepreter/ILIntepreter.cs b/ILRuntime/Runtime/Intepreter/ILIntepreter.cs index 58dc24f4..7d91e594 100644 --- a/ILRuntime/Runtime/Intepreter/ILIntepreter.cs +++ b/ILRuntime/Runtime/Intepreter/ILIntepreter.cs @@ -134,6 +134,13 @@ public object Run(ILMethod method, object instance, object[] p) { arg--; paramCnt++; +/// 为确保性能,暂时先确保开发的时候,安全检查完备。 +/// 当然手机端运行时可能会出现为空的类对象可正常调用成员函数,导致成员函数里面访问成员变量报错时可能使得根据Log跟踪BUG时方向错误。 +#if DEBUG && !DISABLE_ILRUNTIME_DEBUG + var thisObj = mStack[arg->Value]; + if (thisObj == null) + throw new NullReferenceException(); +#endif } unhandledException = false; StackObject* objRef, objRef2, dst, val, a, b, arrRef; From 969817961ceb7de513f7bc167a32f7e3e7638685 Mon Sep 17 00:00:00 2001 From: "[liaoqiang]" Date: Tue, 9 Jun 2020 13:26:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E5=BC=95=E5=8F=91stack=E6=95=B0=E7=BB=84=E8=B6=8A?= =?UTF-8?q?=E7=95=8C=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ILRuntime/Runtime/Intepreter/ILIntepreter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILRuntime/Runtime/Intepreter/ILIntepreter.cs b/ILRuntime/Runtime/Intepreter/ILIntepreter.cs index 7d91e594..26ce1b84 100644 --- a/ILRuntime/Runtime/Intepreter/ILIntepreter.cs +++ b/ILRuntime/Runtime/Intepreter/ILIntepreter.cs @@ -137,7 +137,7 @@ public object Run(ILMethod method, object instance, object[] p) /// 为确保性能,暂时先确保开发的时候,安全检查完备。 /// 当然手机端运行时可能会出现为空的类对象可正常调用成员函数,导致成员函数里面访问成员变量报错时可能使得根据Log跟踪BUG时方向错误。 #if DEBUG && !DISABLE_ILRUNTIME_DEBUG - var thisObj = mStack[arg->Value]; + var thisObj = RetriveObject(arg, mStack); if (thisObj == null) throw new NullReferenceException(); #endif