From 7e39407eb4f9edee20f73514dd6dffaac8031eea Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 25 Dec 2021 18:10:47 +0200 Subject: [PATCH] reorder v_setI --- src/vm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vm.h b/src/vm.h index 1c56dfa1..639fca22 100644 --- a/src/vm.h +++ b/src/vm.h @@ -292,9 +292,11 @@ FORCE_INLINE void v_setI(Scope* sc, u32 p, B x, bool upd, bool chk) { // consume if (upd) { B prev = sc->vars[p]; if (chk && prev.u==bi_noVar.u) thrM("↩: Updating variable that hasn't been set"); + sc->vars[p] = x; dec(prev); + } else { + sc->vars[p] = x; } - sc->vars[p] = x; } FORCE_INLINE void v_set(Scope* pscs[], B s, B x, bool upd, bool chk) { // doesn't consume; if chk is false, content variables _may_ not be checked to be set if (RARE(!isVar(s))) v_setR(pscs, s, x, upd);