From: Jérémie Astor Date: Tue, 8 Dec 2020 01:00:11 +0000 (+0100) Subject: :art: Prohibit import of empty enums X-Git-Tag: nightly~1113 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8429919c7c5f458b9171ce0e0258d3a6155e9a5f;p=gwion.git :art: Prohibit import of empty enums --- diff --git a/src/import/import_enum.c b/src/import/import_enum.c index 1607e576..a68f6aaf 100644 --- a/src/import/import_enum.c +++ b/src/import/import_enum.c @@ -80,6 +80,8 @@ ANN static void import_enum_end(const Gwi gwi, const Vector v) { //! TODO: check what happens in inside template class ANN Type gwi_enum_end(const Gwi gwi) { CHECK_BO(ck_ok(gwi, ck_edef)) + if(!vector_size(&gwi->ck->v)) + GWI_ERR_O("Enum is empty"); const Gwion gwion = gwi->gwion; const Enum_Def edef = new_enum_def(gwion->mp, gwi->ck->tmpl, gwi->ck->xid, loc(gwi));