From 2ac9a76b3b50912ed43efe30d4546318a2e74ccb Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Thu, 2 Jun 2022 15:31:35 +0200 Subject: [PATCH] The task and type ids cannot be negative --- emu_nosv.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/emu_nosv.c b/emu_nosv.c index 6915b89..88d9378 100644 --- a/emu_nosv.c +++ b/emu_nosv.c @@ -263,11 +263,11 @@ pre_task_running(struct ovni_emu *emu, struct nosv_task *task) th = emu->cur_thread; proc = emu->cur_proc; - if(task->id <= 0) - die("task id must be positive\n"); + if(task->id == 0) + die("task id cannot be 0\n"); - if(task->type->gid <= 0) - die("task type gid must be positive\n"); + if(task->type->gid == 0) + die("task type gid cannot be 0\n"); if(proc->appid <= 0) die("app id must be positive\n"); @@ -296,11 +296,11 @@ pre_task_switch(struct ovni_emu *emu, struct nosv_task *prev_task, if(prev_task == next_task) die("cannot switch to the same task\n"); - if(next_task->id <= 0) - die("next task id must be positive\n"); + if(next_task->id == 0) + die("next task id cannot be 0\n"); - if(next_task->type->gid <= 0) - die("next task type id must be positive\n"); + if(next_task->type->gid == 0) + die("next task type id cannot be 0\n"); chan_set(&th->chan[CHAN_NOSV_TASKID], next_task->id);