From 64075b46be6dc33ef3f8c8db96ec0b32a5bd2720 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 15 Jul 2022 13:37:20 +0200 Subject: [PATCH] :art: clean live values in reverse order --- src/vm/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm/vm.c b/src/vm/vm.c index ef769d2b..909f2dae 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -50,7 +50,7 @@ ANN static inline void shred_unwind(const VM_Shred shred) { ANN static void clean_values(const VM_Shred shred) { const VM_Code code = shred->code; const uint16_t pc = shred->pc; - for (m_uint i = 0; i < m_vector_size(&code->live_values); i++) { + for (m_uint i = m_vector_size(&code->live_values) + 1; --i;) { VMValue *vmval = (VMValue *)m_vector_addr(&code->live_values, i); if (pc <= vmval->start) break; if (pc >= vmval->end) continue; -- 2.43.0