Refuse 0 integer size
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 3 Dec 2013 16:13:12 +0000 (17:13 +0100)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 3 Dec 2013 16:13:12 +0000 (17:13 +0100)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-visitor-generate-io-struct.c

index c7de92e61d06eda45017d9313aeb05501b7bbdcf..4515b53e437fb16238530f9371b20a745b79f2b2 100644 (file)
@@ -1319,6 +1319,11 @@ struct bt_declaration *ctf_declaration_integer_visit(FILE *fd, int depth,
                                return NULL;
                        }
                        size = right->u.unary_expression.u.unsigned_constant;
+                       if (!size) {
+                               fprintf(fd, "[error] %s: integer size: expecting non-zero constant\n",
+                                       __func__);
+                               return NULL;
+                       }
                        has_size = 1;
                } else if (!strcmp(left->u.unary_expression.u.string, "align")) {
                        if (right->u.unary_expression.type != UNARY_UNSIGNED_CONSTANT) {
This page took 0.026625 seconds and 4 git commands to generate.