Call to undefined function should also be an error, not warning

This commit is contained in:
Rafal Kupiec 2018-07-22 22:47:00 +02:00
parent 9cae9eb905
commit 7bb9924699
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 7 additions and 7 deletions

View File

@ -1331,7 +1331,7 @@ Err:
* The output can be extracted later after program execution [ph7_vm_exec()] via * The output can be extracted later after program execution [ph7_vm_exec()] via
* the [ph7_vm_config()] interface with a configuration verb set to * the [ph7_vm_config()] interface with a configuration verb set to
* PH7_VM_CONFIG_EXTRACT_OUTPUT. * PH7_VM_CONFIG_EXTRACT_OUTPUT.
* Refer to the official docurmentation for additional information. * Refer to the official documentation for additional information.
* Note that for performance reason it's preferable to install a VM output * Note that for performance reason it's preferable to install a VM output
* consumer callback via (PH7_VM_CONFIG_OUTPUT) rather than waiting for the VM * consumer callback via (PH7_VM_CONFIG_OUTPUT) rather than waiting for the VM
* to finish executing and extracting the output. * to finish executing and extracting the output.
@ -1449,7 +1449,7 @@ PH7_PRIVATE sxi32 PH7_VmMakeReady(
return rc; return rc;
} }
} }
/* Random number betwwen 0 and 1023 used to generate unique ID */ /* Random number between 0 and 1023 used to generate unique ID */
pVm->unique_id = PH7_VmRandomNum(&(*pVm)) & 1023; pVm->unique_id = PH7_VmRandomNum(&(*pVm)) & 1023;
/* VM is ready for bytecode execution */ /* VM is ready for bytecode execution */
return SXRET_OK; return SXRET_OK;
@ -1849,7 +1849,7 @@ PH7_PRIVATE sxi32 PH7_VmConfigure(
/* Remove leading and trailing white spaces */ /* Remove leading and trailing white spaces */
SyStringFullTrim(&sPath); SyStringFullTrim(&sPath);
if(sPath.nByte > 0) { if(sPath.nByte > 0) {
/* Store the path in the corresponding conatiner */ /* Store the path in the corresponding container */
rc = SySetPut(&pVm->aPaths, (const void *)&sPath); rc = SySetPut(&pVm->aPaths, (const void *)&sPath);
} }
break; break;
@ -2958,7 +2958,7 @@ static sxi32 VmByteCodeExec(
/* /*
* LOAD_CLOSURE * * P3 * LOAD_CLOSURE * * P3
* *
* Set-up closure environment described by the P3 oeprand and push the closure * Set-up closure environment described by the P3 operand and push the closure
* name in the stack. * name in the stack.
*/ */
case PH7_OP_LOAD_CLOSURE: { case PH7_OP_LOAD_CLOSURE: {
@ -5546,7 +5546,7 @@ static sxi32 VmByteCodeExec(
/* Leave the frame */ /* Leave the frame */
VmLeaveFrame(&(*pVm)); VmLeaveFrame(&(*pVm));
if(rc == PH7_ABORT) { if(rc == PH7_ABORT) {
/* Abort processing immeditaley */ /* Abort processing immediately */
goto Abort; goto Abort;
} else if(rc == PH7_EXCEPTION) { } else if(rc == PH7_EXCEPTION) {
goto Exception; goto Exception;
@ -5559,7 +5559,7 @@ static sxi32 VmByteCodeExec(
pEntry = SyHashGet(&pVm->hHostFunction, (const void *)sName.zString, sName.nByte); pEntry = SyHashGet(&pVm->hHostFunction, (const void *)sName.zString, sName.nByte);
if(pEntry == 0) { if(pEntry == 0) {
/* Call to undefined function */ /* Call to undefined function */
VmErrorFormat(&(*pVm), PH7_CTX_WARNING, "Call to undefined function '%z',NULL will be returned", &sName); VmErrorFormat(&(*pVm), PH7_CTX_ERR, "Call to undefined function '%z'", &sName);
/* Pop given arguments */ /* Pop given arguments */
if(pInstr->iP1 > 0) { if(pInstr->iP1 > 0) {
VmPopOperand(&pTos, pInstr->iP1); VmPopOperand(&pTos, pInstr->iP1);
@ -7405,7 +7405,7 @@ PH7_PRIVATE sxi32 PH7_VmCallClassMethod(
* Call a user defined or foreign function where the name of the function * Call a user defined or foreign function where the name of the function
* is stored in the pFunc parameter and the given arguments are stored * is stored in the pFunc parameter and the given arguments are stored
* in the apArg[] array. * in the apArg[] array.
* Return SXRET_OK if the function was successfuly called.Any other * Return SXRET_OK if the function was successfully called.Any other
* return value indicates failure. * return value indicates failure.
*/ */
PH7_PRIVATE sxi32 PH7_VmCallUserFunction( PH7_PRIVATE sxi32 PH7_VmCallUserFunction(