aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interfaces/ecpg/preproc/type.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index 4abbf93d191..fa1a05c3025 100644
--- a/src/interfaces/ecpg/preproc/type.c
+++ b/src/interfaces/ecpg/preproc/type.c
@@ -609,7 +609,17 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsize
prefix, ind_prefix, arrsize, type->struct_sizeof,
(ind_p != NULL) ? ind_type->struct_sizeof : NULL);
if (ind_p != NULL && ind_p != &struct_no_indicator)
+ {
ind_p = ind_p->next;
+ if (ind_p == NULL && p->next != NULL) {
+ mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too few members", ind_name);
+ ind_p = &struct_no_indicator;
+ }
+ }
+ }
+
+ if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator) {
+ mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too many members", ind_name);
}
free(pbuf);