No data type for argument specified leads to E_ERROR.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-14 21:33:31 +02:00
parent ca00cadba7
commit 94ae7d187b
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 4 additions and 1 deletions

View File

@ -2935,7 +2935,7 @@ static sxi32 PH7_GenStateCollectFuncArgs(ph7_vm_func *pFunc, ph7_gen_state *pGen
} else {
SyString *pName = &pIn->sData; /* Class name */
char *zDup;
/* Argument must be a class instance,record that*/
/* Argument must be a class instance, record that*/
zDup = SyMemBackendStrDup(&pGen->pVm->sAllocator, pName->zString, pName->nByte);
if(zDup) {
sArg.nType = SXU32_HIGH; /* 0xFFFFFFFF as sentinel */
@ -2959,6 +2959,9 @@ static sxi32 PH7_GenStateCollectFuncArgs(ph7_vm_func *pFunc, ph7_gen_state *pGen
return rc;
}
pIn++; /* Jump the dollar sign */
if(!sArg.nType) {
PH7_GenCompileError(&(*pGen), E_ERROR, pIn->nLine, "Argument '$%z' is of undefined data type", &pIn->sData);
}
/* Copy argument name */
zDup = SyMemBackendStrDup(&pGen->pVm->sAllocator, SyStringData(&pIn->sData), SyStringLength(&pIn->sData));
if(zDup == 0) {