From 724f245e5be0c4ad8e909a23a0dc52ff06043d50 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 22 May 2020 00:09:05 +0200 Subject: [PATCH] fixes --- src/arg.c | 3 +++ src/emit/emit.c | 1 - src/parse/check.c | 3 ++- tests/error/class_inside.gw | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/arg.c b/src/arg.c index eee2bc16..930c7341 100644 --- a/src/arg.c +++ b/src/arg.c @@ -178,6 +178,9 @@ ANN static void config_default(const Gwion gwion , Arg* arg) { ANN m_bool arg_parse(const Gwion gwion, Arg* a) { arg_init(a); +#ifdef __FUZZING + return; +#endif config_default(gwion, a); return _arg_parse(gwion, a); } diff --git a/src/emit/emit.c b/src/emit/emit.c index d4da531a..9a9813cf 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -524,7 +524,6 @@ ANN static m_bool emit_interp(const Emitter emit, const Exp exp) { interp_multi(emit, e); regseti(emit, (m_uint)e->info->type); interp_size(emit, e->info->type); -// regseti(emit, (m_uint)isa(e->info->type, emit->gwion->type[et_object]) > 0); const m_bool isobj = isa(e->info->type, emit->gwion->type[et_object]) > 0; if(isobj) { if(!GET_FLAG(e->info->type, force)) diff --git a/src/parse/check.c b/src/parse/check.c index a066bbd2..87a02f76 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -315,7 +315,8 @@ ANN static Type check_prim_id(const Env env, const Symbol *data) { ANN static Type check_prim_typeof(const Env env, const Exp *exp) { const Exp e = *exp; DECL_OO(const Type, t, = check_exp(env, e)) - return type_class(env->gwion, t); + const Type force = force_type(env, t); + return type_class(env->gwion, force); } ANN static Type check_prim_interp(const Env env, const Exp* exp) { diff --git a/tests/error/class_inside.gw b/tests/error/class_inside.gw index 22afc751..46ffadd3 100644 --- a/tests/error/class_inside.gw +++ b/tests/error/class_inside.gw @@ -1,4 +1,4 @@ -#! [contains] declared inside itself +#! [contains] declared inside class c { c var; } -- 2.43.0