From eb12c1489c9a2f83431d5c202da0eb52ee652c17 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 26 Aug 2022 20:45:17 +0200 Subject: [PATCH] :bug: Fix inherit --- src/env/type.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) { -- 2.43.0