Skip to content

Commit

Permalink
修正为空类对象可正常调用类成员函数,导致报错信息容易引起错误的理解的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoqiang-t4f committed May 20, 2020
1 parent 1742b42 commit 4a4a694
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ILRuntime/Runtime/Intepreter/ILIntepreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4a4a694

Please sign in to comment.