From c003be00ed73b5f4025775ede53d9f47c99c1b61 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sun, 8 Sep 2019 15:29:26 +0200 Subject: [PATCH] :bug: More AFL work --- src/parse/scan0.c | 1 + src/parse/scan2.c | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/parse/scan0.c b/src/parse/scan0.c index 5c5b659a..e87b5614 100644 --- a/src/parse/scan0.c +++ b/src/parse/scan0.c @@ -70,6 +70,7 @@ static void fptr_def(const Env env, const Fptr_Def fptr) { ANN m_bool scan0_fptr_def(const Env env, const Fptr_Def fptr) { CHECK_BB(env_access(env, fptr->base->td->flag, td_pos(fptr->base->td))) + CHECK_OO(known_type(env, fptr->base->td)) CHECK_BB(scan0_defined(env, fptr->base->xid, td_pos(fptr->base->td))); const m_str name = s_name(fptr->base->xid); const Type t = new_type(env->gwion->mp, t_fptr->xid, name, t_fptr); diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 89e51c96..451d3efb 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -157,14 +157,12 @@ ANN static inline m_bool scan2_exp_post(const Env env, const Exp_Postfix* post) return scan2_exp(env, post->exp); } -ANN2(1,2) static inline m_bool scan2_exp_call1(const Env env, const restrict Exp func, - const restrict Exp args) { - CHECK_BB(scan2_exp(env, func)) - return args ? scan2_exp(env, args) : 1; -} - ANN static inline m_bool scan2_exp_call(const Env env, const Exp_Call* exp_call) { - return scan2_exp_call1(env, exp_call->func, exp_call->args); + if(exp_call->tmpl) + return GW_OK; + CHECK_BB(scan2_exp(env, exp_call->func)) + const Exp args = exp_call->args; + return args ? scan2_exp(env, args) : GW_OK; } ANN static inline m_bool scan2_exp_dot(const Env env, const Exp_Dot* member) { -- 2.43.0