Commit d43549a9454b6dfe15da0cb236275f5fcf80ff3b

Thomas de Grivel 2024-04-14T12:16:49

env_def: error handling

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/libc3/env.c b/libc3/env.c
index 401cf33..2229163 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -100,7 +100,8 @@ s_tag * env_def (s_env *env, const s_call *call, s_tag *dest)
   if (! facts_add_tags(&env->facts, &tag_module, &tag_symbol,
                        &tag_ident))
     return NULL;
-  env_eval_tag(env, &list_next(call->arguments)->tag, &tag_value);
+  if (! env_eval_tag(env, &list_next(call->arguments)->tag, &tag_value))
+    return NULL;
   if (tag_value.type == TAG_STRUCT &&
       (s = &tag_value.data.struct_) &&
       s->type->module == &g_sym_C3__Operator) {