mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
CInterface integration in CodeInterpreter null ptr fix
mNSEntry can be null if there is no TorqueScript defintion, but there could still be a result from an externally defined source. ´ Furthermore fixes an issue where StringStackConsoleWrapper would die before the value was read.
This commit is contained in:
parent
d567bc9735
commit
c9609fbdbf
1 changed files with 5 additions and 4 deletions
|
|
@ -2181,14 +2181,15 @@ OPCodeReturn CodeInterpreter::op_callfunc(U32 &ip)
|
||||||
|
|
||||||
// ConsoleFunctionType is for any function defined by script.
|
// ConsoleFunctionType is for any function defined by script.
|
||||||
// Any 'callback' type is an engine function that is exposed to script.
|
// Any 'callback' type is an engine function that is exposed to script.
|
||||||
if (mNSEntry->mType == Namespace::Entry::ConsoleFunctionType
|
if (cFunctionRes || mNSEntry->mType == Namespace::Entry::ConsoleFunctionType)
|
||||||
|| cFunctionRes)
|
|
||||||
{
|
{
|
||||||
|
ConsoleValue retVal;
|
||||||
ConsoleValueRef ret;
|
ConsoleValueRef ret;
|
||||||
if (cFunctionRes)
|
if (cFunctionRes)
|
||||||
{
|
{
|
||||||
StringStackConsoleWrapper retVal(1, &cRetRes);
|
retVal.init();
|
||||||
ret = retVal.argv[0];
|
ret.value = &retVal;
|
||||||
|
retVal.setStackStringValue(cRetRes);
|
||||||
}
|
}
|
||||||
else if (mNSEntry->mFunctionOffset)
|
else if (mNSEntry->mFunctionOffset)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue