From 8429919c7c5f458b9171ce0e0258d3a6155e9a5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 8 Dec 2020 02:00:11 +0100 Subject: [PATCH] :art: Prohibit import of empty enums --- src/import/import_enum.c | 2 ++ 1 file changed, 2 insertions(+) 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)); -- 2.43.0