]> Nishi Git Mirror - gwion.git/commitdiff
:bug: more bugfixes (thanks to AFL)
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 9 Apr 2019 19:50:28 +0000 (21:50 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 9 Apr 2019 19:50:28 +0000 (21:50 +0200)
src/lib/array.c

index f80904b7ae45afad5e9b0532215b39e765f67f55..dc6e349ce4e3b8b3afa7f1df59755c77b7694677 100644 (file)
@@ -151,8 +151,14 @@ ANN static Type get_array_type(Type t) {
 
 static OP_CHECK(opck_array_at) {
   ARRAY_OPCK
+  if(opck_const_rhs(env, data) == t_null)
+    return t_null;
   if(bin->lhs->type->array_depth != bin->rhs->type->array_depth)
     ERR_N(exp_self(bin)->pos, "array depths do not match.")
+  if(bin->rhs->exp_type == ae_exp_decl) {
+    if(bin->rhs->d.exp_decl.list->self->array)
+      ERR_N(exp_self(bin)->pos, "do not provide array for 'xxx @=> declaration'.")
+  }
   bin->rhs->emit_var = 1;
   return bin->rhs->type;
 }