From 41211eec8abbd8c06831af95b366fdda093d4a97 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 29 Oct 2021 17:48:04 +0200 Subject: [PATCH] Use the values as-is for appid, taskid and typeid --- emu_nosv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/emu_nosv.c b/emu_nosv.c index 108e1a4..bb76989 100644 --- a/emu_nosv.c +++ b/emu_nosv.c @@ -214,9 +214,13 @@ pre_task_running(struct ovni_emu *emu, struct nosv_task *task) th = emu->cur_thread; proc = emu->cur_proc; - chan_set(&th->chan[CHAN_NOSV_TASKID], task->id + 1); - chan_set(&th->chan[CHAN_NOSV_TYPEID], task->type_id + 1); - chan_set(&th->chan[CHAN_NOSV_APPID], proc->appid + 1); + assert(task->id > 0); + assert(task->type_id > 0); + assert(proc->appid > 0); + + chan_set(&th->chan[CHAN_NOSV_TASKID], task->id); + chan_set(&th->chan[CHAN_NOSV_TYPEID], task->type_id); + chan_set(&th->chan[CHAN_NOSV_APPID], proc->appid); chan_push(&th->chan[CHAN_NOSV_SUBSYSTEM], ST_NOSV_TASK_RUNNING); }