Browse Source

Variable list of arguments for PH7_VmGenericError();

release/v0.1
Rafal Kupiec 3 years ago
parent
commit
9c4eb59b49
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      engine/vm.c

+ 6
- 2
engine/vm.c View File

@ -1904,7 +1904,8 @@ PH7_PRIVATE sxi32 PH7_VmMemoryError(
PH7_PRIVATE sxi32 PH7_VmGenericError(
ph7_vm *pVm, /* Target VM */
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;
sxi32 rc = SXRET_OK;
@ -1924,6 +1925,7 @@ PH7_PRIVATE sxi32 PH7_VmGenericError(
break;
}
if(pVm->bErrReport) {
va_list ap;
SyBlob sWorker;
SySet pDebug;
VmDebugTrace *pTrace;
@ -1949,7 +1951,9 @@ PH7_PRIVATE sxi32 PH7_VmGenericError(
/* Initialize the working buffer */
SyBlobInit(&sWorker, &pVm->sAllocator);
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 */
SyBlobFormat(&sWorker, " in %z:%u", pFile, nLine);
if(SySetUsed(&pDebug) > 0) {


Loading…
Cancel
Save