From f78b863513d0f7959a48e01a542041e615b83143 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 1 Oct 2019 20:23:24 +0200 Subject: [PATCH] :fire: Use of subscript check --- src/parse/check.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/parse/check.c b/src/parse/check.c index 0435deb6..92d200d3 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -38,12 +38,11 @@ ANN static m_bool check_implicit(const Env env, const m_str str, return GW_OK; } -ANN m_bool check_exp_array_subscripts(const Env env, const Exp exp) { +ANN m_bool check_exp_array_subscripts(Env env, Exp exp) { CHECK_OB(check_exp(env, exp)) - const Type t = env->gwion->type[et_int]; - Exp e = exp; - do CHECK_BB(check_implicit(env, "@access", e, t)) - while((e = e->next)); + do if(isa(exp->type, env->gwion->type[et_int]) < 0) + ERR_B(exp->pos, _("incompatible array subscript type '%s' ..."), exp->type->name) + while((exp = exp->next)); return GW_OK; } -- 2.43.0