Correct arguments length. Get rid of some additional non-printable characters from the end of string.
All checks were successful
The build was successful.
All checks were successful
The build was successful.
This commit is contained in:
parent
ab36234ff3
commit
b527840f10
10
engine/vm.c
10
engine/vm.c
@ -5023,8 +5023,8 @@ PH7_PRIVATE sxi32 PH7_VmByteCodeExec(ph7_vm *pVm) {
|
|||||||
ph7_class_method *pMethod;
|
ph7_class_method *pMethod;
|
||||||
ph7_value *pArgs, *sArgv, *pObj;
|
ph7_value *pArgs, *sArgv, *pObj;
|
||||||
ph7_value pResult;
|
ph7_value pResult;
|
||||||
char *zDup;
|
char *zDup, *zParam;
|
||||||
const char *zStr, *zParam;
|
sxu32 nByte;
|
||||||
/* Make sure we are ready to execute this program */
|
/* Make sure we are ready to execute this program */
|
||||||
if(pVm->nMagic != PH7_VM_RUN) {
|
if(pVm->nMagic != PH7_VM_RUN) {
|
||||||
return (pVm->nMagic == PH7_VM_EXEC || pVm->nMagic == PH7_VM_INCL) ? SXERR_LOCKED /* Locked VM */ : SXERR_CORRUPT; /* Stale VM */
|
return (pVm->nMagic == PH7_VM_EXEC || pVm->nMagic == PH7_VM_INCL) ? SXERR_LOCKED /* Locked VM */ : SXERR_CORRUPT; /* Stale VM */
|
||||||
@ -5055,9 +5055,9 @@ PH7_PRIVATE sxi32 PH7_VmByteCodeExec(ph7_vm *pVm) {
|
|||||||
if(!pArgs || !sArgv) {
|
if(!pArgs || !sArgv) {
|
||||||
PH7_VmMemoryError(&(*pVm));
|
PH7_VmMemoryError(&(*pVm));
|
||||||
}
|
}
|
||||||
if(SyBlobLength(&pVm->sArgv) > 0) {
|
nByte = SyBlobLength(&pVm->sArgv);
|
||||||
zStr = (const char *)SyBlobData(&pVm->sArgv);
|
if(nByte > 0) {
|
||||||
zDup = SyMemBackendStrDup(&pVm->sAllocator, zStr, SyStrlen(zStr));
|
zDup = SyMemBackendStrDup(&pVm->sAllocator, SyBlobData(&pVm->sArgv), nByte);
|
||||||
zParam = SyStrtok(zDup, " ");
|
zParam = SyStrtok(zDup, " ");
|
||||||
while(zParam != NULL) {
|
while(zParam != NULL) {
|
||||||
ph7_value_string(sArgv, zParam, SyStrlen(zParam));
|
ph7_value_string(sArgv, zParam, SyStrlen(zParam));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user