bool prog_exec(qc_program *prog, prog_section_function *func, size_t flags, long maxjumps)
{
long jumpcount = 0;
+ size_t oldxflags = prog->xflags;
prog_section_statement *st;
prog->vmerror = 0;
+ prog->xflags = flags;
st = prog->code + prog_enterfunction(prog, func);
--st;
};
cleanup:
+ prog->xflags = oldxflags;
prog->localstack_count = 0;
prog->stack_count = 0;
if (prog->vmerror)
static int qc_print(qc_program *prog)
{
size_t i;
+ const char *laststr = NULL;
for (i = 0; i < prog->argc; ++i) {
qcany *str = (qcany*)(prog->globals + OFS_PARM0 + 3*i);
- printf("%s", prog_getstring(prog, str->string));
+ printf("%s", (laststr = prog_getstring(prog, str->string)));
+ }
+ if (laststr && (prog->xflags & VMXF_TRACE)) {
+ size_t len = strlen(laststr);
+ if (!len || laststr[len-1] != '\n')
+ printf("\n");
}
return 0;
}