Consider a method with compiled default value associated as a candidate to call. Fixes #37.
All checks were successful
The build was successful.
All checks were successful
The build was successful.
This commit is contained in:
parent
e15166d940
commit
8f7fc71027
10
engine/vm.c
10
engine/vm.c
|
@ -601,6 +601,7 @@ static ph7_vm_func *VmOverload(
|
||||||
int iTarget, i, j, iArgs, iCur, iMax;
|
int iTarget, i, j, iArgs, iCur, iMax;
|
||||||
ph7_vm_func *apSet[10]; /* Maximum number of candidates */
|
ph7_vm_func *apSet[10]; /* Maximum number of candidates */
|
||||||
ph7_vm_func *pLink;
|
ph7_vm_func *pLink;
|
||||||
|
ph7_vm_func_arg *pFuncArg;
|
||||||
SyString sArgSig;
|
SyString sArgSig;
|
||||||
SyBlob sSig;
|
SyBlob sSig;
|
||||||
pLink = pList;
|
pLink = pList;
|
||||||
|
@ -612,13 +613,18 @@ static ph7_vm_func *VmOverload(
|
||||||
}
|
}
|
||||||
iArgs = (int) SySetUsed(&pLink->aArgs);
|
iArgs = (int) SySetUsed(&pLink->aArgs);
|
||||||
if(nArg == iArgs) {
|
if(nArg == iArgs) {
|
||||||
/* Exact amount of parameters, a candidate for overloading */
|
/* Exact amount of parameters, a candidate to call */
|
||||||
apSet[i++] = pLink;
|
apSet[i++] = pLink;
|
||||||
} else if(nArg < iArgs) {
|
} else if(nArg < iArgs) {
|
||||||
/* Fewer parameters passed, check if all are required */
|
/* Fewer parameters passed, check if all are required */
|
||||||
/* Temporarily a candidate for overloading to fix master branch */
|
pFuncArg = (ph7_vm_func_arg *) SySetAt(&pLink->aArgs, nArg);
|
||||||
|
if(pFuncArg) {
|
||||||
|
if(SySetUsed(&pFuncArg->aByteCode) >= 1) {
|
||||||
|
/* First missing parameter has a compiled default value associated, a candidate to call */
|
||||||
apSet[i++] = pLink;
|
apSet[i++] = pLink;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/* Point to the next entry */
|
/* Point to the next entry */
|
||||||
pLink = pLink->pNextName;
|
pLink = pLink->pNextName;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user