Variable list of arguments for PH7_VmGenericError();
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2018-09-03 09:30:23 +02:00
parent f176414bce
commit 9c4eb59b49
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 2 deletions

View File

@ -1904,7 +1904,8 @@ PH7_PRIVATE sxi32 PH7_VmMemoryError(
PH7_PRIVATE sxi32 PH7_VmGenericError( PH7_PRIVATE sxi32 PH7_VmGenericError(
ph7_vm *pVm, /* Target VM */ ph7_vm *pVm, /* Target VM */
sxi32 iErr, /* Severity level: [i.e: Error, Warning, Notice or Deprecated] */ sxi32 iErr, /* Severity level: [i.e: Error, Warning, Notice or Deprecated] */
const char *zMessage /* Null terminated error message */ const char *zMessage, /* Null terminated error message */
... /* Variable list of arguments */
) { ) {
const char *zErr; const char *zErr;
sxi32 rc = SXRET_OK; sxi32 rc = SXRET_OK;
@ -1924,6 +1925,7 @@ PH7_PRIVATE sxi32 PH7_VmGenericError(
break; break;
} }
if(pVm->bErrReport) { if(pVm->bErrReport) {
va_list ap;
SyBlob sWorker; SyBlob sWorker;
SySet pDebug; SySet pDebug;
VmDebugTrace *pTrace; VmDebugTrace *pTrace;
@ -1949,7 +1951,9 @@ PH7_PRIVATE sxi32 PH7_VmGenericError(
/* Initialize the working buffer */ /* Initialize the working buffer */
SyBlobInit(&sWorker, &pVm->sAllocator); SyBlobInit(&sWorker, &pVm->sAllocator);
SyBlobAppend(&sWorker, zErr, SyStrlen(zErr)); SyBlobAppend(&sWorker, zErr, SyStrlen(zErr));
SyBlobAppend(&sWorker, zMessage, SyStrlen(zMessage)); va_start(ap, zMessage);
SyBlobFormatAp(&sWorker, zMessage, ap);
va_end(ap);
/* Append file name and line number */ /* Append file name and line number */
SyBlobFormat(&sWorker, " in %z:%u", pFile, nLine); SyBlobFormat(&sWorker, " in %z:%u", pFile, nLine);
if(SySetUsed(&pDebug) > 0) { if(SySetUsed(&pDebug) > 0) {