From f29769931151aed8d375c3df65a9616d953c9f63 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Mon, 30 Sep 2019 11:20:36 +0200 Subject: [PATCH] :art: check usr ops --- src/parse/scan1.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 2d85ffcb..bd864bf4 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -359,12 +359,14 @@ ANN m_bool scan1_func_def(const Env env, const Func_Def fdef) { CHECK_BB(env_storage(env, fdef->flag, td_pos(fdef->base->td))) if(tmpl_base(fdef->base->tmpl)) return GW_OK; - if(fdef->base->xid == insert_symbol("@dtor") || fdef->base->xid == insert_symbol("@gack")) { - if(!env->class_def) - ERR_B(td_pos(fdef->base->td), _("'%s' must be in class def!!"), s_name(fdef->base->xid)) - if(fdef->base->args)exit(3); - } else if(GET_FLAG(fdef, op) && env->class_def) - SET_FLAG(fdef, static); + if(GET_FLAG(fdef, op)) { + if(fdef->base->xid == insert_symbol("@dtor") || fdef->base->xid == insert_symbol("@gack")) { + if(!env->class_def) + ERR_B(td_pos(fdef->base->td), _("'%s' must be in class def!!"), s_name(fdef->base->xid)) + if(fdef->base->args)exit(3); + } else if(env->class_def) + SET_FLAG(fdef, static); + } struct Func_ fake = { .name=s_name(fdef->base->xid) }, *const former = env->func; env->func = &fake; ++env->scope->depth; -- 2.43.0