From 898726af3584136f0ccf59cb91fa984a52c258ef Mon Sep 17 00:00:00 2001 From: Redo Date: Fri, 4 Nov 2022 17:13:27 -0600 Subject: [PATCH] fix off by one segfault --- sim/group.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/group.lua b/sim/group.lua index 0d37e80..8efe588 100644 --- a/sim/group.lua +++ b/sim/group.lua @@ -216,8 +216,8 @@ function Group.update_net_c(netc, tick) netc.state[0] = state netc.update_tick[0] = tick - local len = netc.num_gates_update[0] - for i = 1, len do + local len = netc.num_gates_update[0]-1 + for i = 0, len do local gatec = netc.gates_update_c[i] if gatec and gatec.in_queue[0]==0 then Simulation.queue_gate_c(GSim, gatec)