From 9cf6e6657826bbedcd8c2933a995eaff82a01b3f Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Wed, 27 Jul 2022 14:04:58 +0200 Subject: [PATCH] :bug: Fix pop_global --- src/gwion.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gwion.c b/src/gwion.c index 1c28cca0..97a74fbf 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -243,12 +243,13 @@ ANN void push_global(struct Gwion_ *gwion, const m_str name) { } ANN void pop_global(const Gwion gwion) { - Nspc nspc = gwion->env->global_nspc->parent, parent; + Nspc nspc = gwion->env->global_nspc->parent; // Nspc nspc = gwion->env->global_nspc, parent; - do { - parent = nspc->parent; + while (nspc) { + const Nspc parent = nspc->parent; nspc_remref(nspc, gwion); - } while((nspc = parent)); + nspc = parent; + } } ANN void gwion_set_debug(const Gwion gwion, const bool dbg) { -- 2.43.0