Do not count compilation errors.
Todas as verificações foram bem sucedidas
The build was successful.
Todas as verificações foram bem sucedidas
The build was successful.
Interpreter will abort script execution on first error found.
Esse commit está contido em:
@@ -695,15 +695,14 @@ static sxi32 ProcessSourceFile(
|
||||
}
|
||||
/* Compile the script */
|
||||
PH7_CompileAerScript(pVm, &(*pScript), PH7_AERSCRIPT_CODE);
|
||||
if(pVm->sCodeGen.nErr > 0 || pVm == 0) {
|
||||
sxu32 nErr = pVm->sCodeGen.nErr;
|
||||
/* Compilation error or null ppVm pointer,release this VM */
|
||||
if(pVm == 0) {
|
||||
/* Null ppVm pointer,release this VM */
|
||||
SyMemBackendRelease(&pVm->sAllocator);
|
||||
SyMemBackendPoolFree(&pEngine->sAllocator, pVm);
|
||||
if(ppVm) {
|
||||
*ppVm = 0;
|
||||
}
|
||||
return nErr > 0 ? PH7_COMPILE_ERR : PH7_OK;
|
||||
return PH7_OK;
|
||||
}
|
||||
/* Prepare the virtual machine for bytecode execution */
|
||||
rc = PH7_VmMakeReady(pVm);
|
||||
|
||||
@@ -4953,7 +4953,6 @@ PH7_PRIVATE sxi32 PH7_ResetCodeGenerator(
|
||||
pGen->pCurrent = &pGen->sGlobal;
|
||||
pGen->pRawIn = pGen->pRawEnd = 0;
|
||||
pGen->pIn = pGen->pEnd = 0;
|
||||
pGen->nErr = 0;
|
||||
return SXRET_OK;
|
||||
}
|
||||
/*
|
||||
@@ -4972,22 +4971,6 @@ PH7_PRIVATE sxi32 PH7_GenCompileError(ph7_gen_state *pGen, sxi32 nErrType, sxu32
|
||||
SyBlobReset(pWorker);
|
||||
/* Peek the processed file path if available */
|
||||
pFile = (SyString *)SySetPeek(&pGen->pVm->aFiles);
|
||||
if(nErrType == E_ERROR) {
|
||||
/* Increment the error counter */
|
||||
pGen->nErr++;
|
||||
if(pGen->nErr > 15) {
|
||||
/* Error count limit reached */
|
||||
if(pGen->xErr) {
|
||||
SyBlobFormat(pWorker, "%u Error count limit reached,PH7 is aborting compilation\n", nLine);
|
||||
if(SyBlobLength(pWorker) > 0) {
|
||||
/* Consume the generated error message */
|
||||
pGen->xErr(SyBlobData(pWorker), SyBlobLength(pWorker), pGen->pErrData);
|
||||
}
|
||||
}
|
||||
/* Abort immediately */
|
||||
return SXERR_ABORT;
|
||||
}
|
||||
}
|
||||
if(pGen->xErr == 0) {
|
||||
/* No available error consumer,return immediately */
|
||||
return SXRET_OK;
|
||||
|
||||
@@ -9479,12 +9479,6 @@ static sxi32 VmEvalChunk(
|
||||
}
|
||||
/* Compile the chunk */
|
||||
PH7_CompileAerScript(pVm, pChunk, iFlags);
|
||||
if(pVm->sCodeGen.nErr > 0) {
|
||||
/* Compilation error,return false */
|
||||
if(pCtx) {
|
||||
ph7_result_bool(pCtx, 0);
|
||||
}
|
||||
} else {
|
||||
ph7_value sResult; /* Return value */
|
||||
SyHashEntry *pEntry;
|
||||
/* Initialize and install static and constants class attributes */
|
||||
@@ -9513,7 +9507,6 @@ static sxi32 VmEvalChunk(
|
||||
ph7_result_value(pCtx, &sResult);
|
||||
}
|
||||
PH7_MemObjRelease(&sResult);
|
||||
}
|
||||
Cleanup:
|
||||
/* Cleanup the mess left behind */
|
||||
pVm->pByteContainer = pByteCode;
|
||||
|
||||
@@ -904,7 +904,6 @@ struct ph7_gen_state {
|
||||
SyBlob sErrBuf; /* Error buffer */
|
||||
SyToken *pIn; /* Current processed token */
|
||||
SyToken *pEnd; /* Last token in the stream */
|
||||
sxu32 nErr; /* Total number of compilation error */
|
||||
SyToken *pRawIn; /* Current processed raw token */
|
||||
SyToken *pRawEnd; /* Last raw token in the stream */
|
||||
SySet *pTokenSet; /* Token containers */
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário