mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Check for NULL on the thisObject before using it. Also cleanup break to goto.
This commit is contained in:
parent
918509d59a
commit
12134ceb2b
1 changed files with 14 additions and 6 deletions
|
|
@ -400,11 +400,11 @@ ConsoleValueRef CodeInterpreter::exec(U32 ip,
|
||||||
breakContinueLabel:
|
breakContinueLabel:
|
||||||
OPCodeReturn ret = (this->*gOpCodeArray[mCurrentInstruction])(ip);
|
OPCodeReturn ret = (this->*gOpCodeArray[mCurrentInstruction])(ip);
|
||||||
if (ret == OPCodeReturn::exitCode)
|
if (ret == OPCodeReturn::exitCode)
|
||||||
goto exitLabel;
|
break;
|
||||||
else if (ret == OPCodeReturn::breakContinue)
|
else if (ret == OPCodeReturn::breakContinue)
|
||||||
goto breakContinueLabel;
|
goto breakContinueLabel;
|
||||||
}
|
}
|
||||||
exitLabel:
|
|
||||||
if (telDebuggerOn && setFrame < 0)
|
if (telDebuggerOn && setFrame < 0)
|
||||||
TelDebugger->popStackFrame();
|
TelDebugger->popStackFrame();
|
||||||
|
|
||||||
|
|
@ -2133,7 +2133,7 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip)
|
||||||
if (!mExec.noCalls && !(routingId == MethodOnComponent))
|
if (!mExec.noCalls && !(routingId == MethodOnComponent))
|
||||||
{
|
{
|
||||||
Con::warnf(ConsoleLogEntry::General, "%s: Unknown command %s.", mCodeBlock->getFileLine(ip - 6), fnName);
|
Con::warnf(ConsoleLogEntry::General, "%s: Unknown command %s.", mCodeBlock->getFileLine(ip - 6), fnName);
|
||||||
if (callType == FuncCallExprNode::MethodCall)
|
if (callType == FuncCallExprNode::MethodCall && gEvalState.thisObject != NULL)
|
||||||
{
|
{
|
||||||
Con::warnf(ConsoleLogEntry::General, " Object %s(%d) %s",
|
Con::warnf(ConsoleLogEntry::General, " Object %s(%d) %s",
|
||||||
gEvalState.thisObject->getName() ? gEvalState.thisObject->getName() : "",
|
gEvalState.thisObject->getName() ? gEvalState.thisObject->getName() : "",
|
||||||
|
|
@ -2522,9 +2522,17 @@ OPCodeReturn CodeInterpreter::op_callfunc_this(U32 &ip)
|
||||||
if (!mExec.noCalls)
|
if (!mExec.noCalls)
|
||||||
{
|
{
|
||||||
Con::warnf(ConsoleLogEntry::General, "%s: Unknown command %s.", mCodeBlock->getFileLine(ip - 6), fnName);
|
Con::warnf(ConsoleLogEntry::General, "%s: Unknown command %s.", mCodeBlock->getFileLine(ip - 6), fnName);
|
||||||
Con::warnf(ConsoleLogEntry::General, " Object %s(%d) %s",
|
if (mThisObject)
|
||||||
mThisObject->getName() ? mThisObject->getName() : "",
|
{
|
||||||
mThisObject->getId(), Con::getNamespaceList(ns));
|
Con::warnf(ConsoleLogEntry::General, " Object %s(%d) %s",
|
||||||
|
mThisObject->getName() ? mThisObject->getName() : "",
|
||||||
|
mThisObject->getId(), Con::getNamespaceList(ns));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// At least let the scripter know that they access the object.
|
||||||
|
Con::warnf(ConsoleLogEntry::General, " Object is NULL.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
STR.popFrame();
|
STR.popFrame();
|
||||||
CSTK.popFrame();
|
CSTK.popFrame();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue