From: fennecdjay Date: Fri, 15 Jul 2022 11:37:20 +0000 (+0200) Subject: :art: clean live values in reverse order X-Git-Tag: nightly~264^2~98 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=64075b46be6dc33ef3f8c8db96ec0b32a5bd2720;p=gwion.git :art: clean live values in reverse order --- 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;