From: fennecdjay Date: Fri, 26 Aug 2022 18:45:17 +0000 (+0200) Subject: :bug: Fix inherit X-Git-Tag: nightly~264^2~23 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=eb12c1489c9a2f83431d5c202da0eb52ee652c17;p=gwion.git :bug: Fix inherit --- diff --git a/src/env/type.c b/src/env/type.c index 453e8fa8..e0e2ed18 100644 --- a/src/env/type.c +++ b/src/env/type.c @@ -149,9 +149,8 @@ ANN Type actual_type(const struct Gwion_ *gwion, const Type t) { ANN void inherit(const Type t) { const Nspc nspc = t->nspc, parent = t->info->parent->nspc; - if (!nspc || !parent) return; - nspc->offset = parent->offset; - if (parent->vtable.ptr) vector_copy2(&parent->vtable, &nspc->vtable); + if (nspc) nspc->offset = parent->offset; + if (parent && parent->vtable.ptr) vector_copy2(&parent->vtable, &nspc->vtable); } ANN bool from_global_nspc(const Env env, const Nspc nspc) {