From e03c0c19094c810a195b923cc9cd4880717eb815 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Fri, 6 May 2022 13:35:54 +0200 Subject: [PATCH] :art: Improve resolve security --- src/parse/type_decl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/parse/type_decl.c b/src/parse/type_decl.c index 4ff838a8..2106ba7d 100644 --- a/src/parse/type_decl.c +++ b/src/parse/type_decl.c @@ -46,8 +46,8 @@ ANN static inline Type ref(const Env env, Type_Decl *td) { ANN static Symbol symname(const Env env, Func_Base *const base, bool *global) { GwText text = { .mp = env->gwion->mp }; text_add(&text, "("); - const Type t = known_type(env, base->td); - const m_str name = type2str(env->gwion, t, base->td->pos); + DECL_OO(const Type, t, = known_type(env, base->td)); + DECL_OO(const m_str, name, = type2str(env->gwion, t, base->td->pos)); text_add(&text, name); free_mstr(env->gwion->mp, name); text_add(&text, "("); @@ -56,8 +56,8 @@ ANN static Symbol symname(const Env env, Func_Base *const base, bool *global) { for(uint32_t i = 0; i < base->args->len; i++) { if(i) text_add(&text, ","); Arg *arg = mp_vector_at(base->args, Arg, i); - const Type t = known_type(env, arg->td); - const m_str name = type2str(env->gwion, t, arg->td->pos); + DECL_OO(const Type, t, = known_type(env, arg->td)); + DECL_OO(const m_str, name, = type2str(env->gwion, t, arg->td->pos)); text_add(&text, name); free_mstr(env->gwion->mp, name); if(*global) @@ -74,7 +74,7 @@ ANN static Symbol symname(const Env env, Func_Base *const base, bool *global) { ANN static inline Type find(const Env env, Type_Decl *td) { if (!td->fptr) return find_type(env, td); bool global; - td->xid = symname(env, td->fptr->base, &global); + CHECK_OO((td->xid = symname(env, td->fptr->base, &global))); const Fptr_Def fptr = td->fptr; td->fptr = NULL; const Type exists = find_type(env, td); -- 2.43.0