mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #955 from Azaezel/EvalReturn_issue_953
Eval return issue 953 and trace buffer 952
This commit is contained in:
commit
ae00e3046f
1 changed files with 9 additions and 6 deletions
|
|
@ -470,11 +470,11 @@ ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thi
|
||||||
dSprintf(traceBuffer + dStrlen(traceBuffer), sizeof(traceBuffer) - dStrlen(traceBuffer),
|
dSprintf(traceBuffer + dStrlen(traceBuffer), sizeof(traceBuffer) - dStrlen(traceBuffer),
|
||||||
"%s(", thisFunctionName);
|
"%s(", thisFunctionName);
|
||||||
}
|
}
|
||||||
for(i = 0; i < argc; i++)
|
for (i = 0; i < wantedArgc; i++)
|
||||||
{
|
{
|
||||||
dStrcat(traceBuffer, argv[i+1]);
|
dStrcat(traceBuffer, argv[i + 1]);
|
||||||
if(i != argc - 1)
|
if (i != wantedArgc - 1)
|
||||||
dStrcat(traceBuffer, ", ");
|
dStrcat(traceBuffer, ", ");
|
||||||
}
|
}
|
||||||
dStrcat(traceBuffer, ")");
|
dStrcat(traceBuffer, ")");
|
||||||
Con::printf("%s", traceBuffer);
|
Con::printf("%s", traceBuffer);
|
||||||
|
|
@ -1817,7 +1817,7 @@ breakContinue:
|
||||||
ConsoleValueRef ret;
|
ConsoleValueRef ret;
|
||||||
if(nsEntry->mFunctionOffset)
|
if(nsEntry->mFunctionOffset)
|
||||||
ret = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage);
|
ret = nsEntry->mCode->exec(nsEntry->mFunctionOffset, fnName, nsEntry->mNamespace, callArgc, callArgv, false, nsEntry->mPackage);
|
||||||
|
|
||||||
STR.popFrame();
|
STR.popFrame();
|
||||||
// Functions are assumed to return strings, so look ahead to see if we can skip the conversion
|
// Functions are assumed to return strings, so look ahead to see if we can skip the conversion
|
||||||
if(code[ip] == OP_STR_TO_UINT)
|
if(code[ip] == OP_STR_TO_UINT)
|
||||||
|
|
@ -1831,10 +1831,13 @@ breakContinue:
|
||||||
floatStack[++_FLT] = (F32)ret;
|
floatStack[++_FLT] = (F32)ret;
|
||||||
}
|
}
|
||||||
else if(code[ip] == OP_STR_TO_NONE)
|
else if(code[ip] == OP_STR_TO_NONE)
|
||||||
|
{
|
||||||
|
STR.setStringValue(ret.getStringValue());
|
||||||
ip++;
|
ip++;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
STR.setStringValue((const char*)ret);
|
STR.setStringValue((const char*)ret);
|
||||||
|
|
||||||
// This will clear everything including returnValue
|
// This will clear everything including returnValue
|
||||||
CSTK.popFrame();
|
CSTK.popFrame();
|
||||||
STR.clearFunctionOffset();
|
STR.clearFunctionOffset();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue