From: fennecdjay Date: Wed, 27 Jul 2022 12:04:58 +0000 (+0200) Subject: :bug: Fix pop_global X-Git-Tag: nightly~264^2~74 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9cf6e6657826bbedcd8c2933a995eaff82a01b3f;p=gwion.git :bug: Fix pop_global --- 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) {