From a6a2cb2d160a97ca9495101ff7c0560cece82b6b Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Thu, 11 Oct 2018 23:48:03 +0000 Subject: [PATCH] pacified an old c compiler --- moo/lib/comp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/moo/lib/comp.c b/moo/lib/comp.c index 36c1c86..2e4d373 100644 --- a/moo/lib/comp.c +++ b/moo/lib/comp.c @@ -3147,10 +3147,11 @@ static int method_exists (moo_t* moo, const moo_oocs_t* name) else { /* this function must be called from the inteface or the class context only */ + moo_cunit_class_t* cc = (moo_cunit_class_t*)moo->c->cunit; + MOO_ASSERT (moo, moo->c->cunit->cunit_type == MOO_CUNIT_CLASS); /* check if the current class contains a method of the given name */ - moo_cunit_class_t* cc = (moo_cunit_class_t*)moo->c->cunit; if (cc->mth.type == MOO_METHOD_DUAL) { return moo_lookupdic(moo, cc->self_oop->mthdic[MOO_METHOD_INSTANCE], name) != MOO_NULL || @@ -4247,10 +4248,11 @@ static MOO_INLINE int find_dotted_ident (moo_t* moo, const moo_oocs_t* name, con } else { + moo_cunit_class_t* cc = (moo_cunit_class_t*)moo->c->cunit; + MOO_ASSERT (moo, moo->c->cunit->cunit_type == MOO_CUNIT_CLASS); /* called inside a class definition */ - moo_cunit_class_t* cc = (moo_cunit_class_t*)moo->c->cunit; if (cc->super_oop) { /* [NOTE]