Return a VmByteCodeExec() return value from inside a PH7_VmCallUserFunction().
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-04 13:08:51 +02:00
parent 84b5fd2717
commit c3184eb3ea
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 3 additions and 2 deletions

View File

@ -6586,6 +6586,7 @@ PH7_PRIVATE sxi32 PH7_VmCallUserFunction(
) { ) {
ph7_value *aStack; ph7_value *aStack;
VmInstr aInstr[2]; VmInstr aInstr[2];
sxi32 rc;
int i; int i;
if((pFunc->nType & (MEMOBJ_CALL | MEMOBJ_STRING)) == 0) { if((pFunc->nType & (MEMOBJ_CALL | MEMOBJ_STRING)) == 0) {
/* Don't bother processing,it's invalid anyway */ /* Don't bother processing,it's invalid anyway */
@ -6630,10 +6631,10 @@ PH7_PRIVATE sxi32 PH7_VmCallUserFunction(
aInstr[1].iLine = 1; aInstr[1].iLine = 1;
aInstr[1].pFile = (SyString *)&sFileName; aInstr[1].pFile = (SyString *)&sFileName;
/* Execute the function body (if available) */ /* Execute the function body (if available) */
VmByteCodeExec(&(*pVm), aInstr, aStack, nArg, pResult, 0, TRUE); rc = VmByteCodeExec(&(*pVm), aInstr, aStack, nArg, pResult, 0, TRUE);
/* Clean up the mess left behind */ /* Clean up the mess left behind */
SyMemBackendFree(&pVm->sAllocator, aStack); SyMemBackendFree(&pVm->sAllocator, aStack);
return PH7_OK; return rc;
} }
/* /*
* Call a user defined or foreign function with a variable number * Call a user defined or foreign function with a variable number