From 12ba56341652d0af4d2f1135c0f6cb5c3b84efba Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 11 May 2019 10:51:43 +0200 Subject: [PATCH] Add assertions --- m-tuple.h | 1 + 1 file changed, 1 insertion(+) diff --git a/m-tuple.h b/m-tuple.h index 6a559617..18ac2b33 100644 --- a/m-tuple.h +++ b/m-tuple.h @@ -444,6 +444,7 @@ namespace m_tuple { while (ret == M_SERIAL_OK_CONTINUE) { \ ret = f->interface->read_tuple_id(f, field_name, field_max, &index); \ if (ret == M_SERIAL_OK_CONTINUE) { \ + assert (index >= 0 && index < field_max); \ switch (1+index) { \ M_MAP2(TUPLE_DEFINE_IN_SERIAL_FUNC , name, __VA_ARGS__) \ default: assert(0); \