X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-visitor-semantic-validator.c;h=b89f7bd7660d0d363faf4dab4dd77d009bb57320;hp=5f72e0b42b1652c9a9929ceeb59b91733d282988;hb=7c7835b045c7457dc13ac83a7af1b1c1df5843cb;hpb=64fa3fec6c28f1d077812b4bfa06ae73b0f5999d diff --git a/formats/ctf/metadata/ctf-visitor-semantic-validator.c b/formats/ctf/metadata/ctf-visitor-semantic-validator.c index 5f72e0b4..b89f7bd7 100644 --- a/formats/ctf/metadata/ctf-visitor-semantic-validator.c +++ b/formats/ctf/metadata/ctf-visitor-semantic-validator.c @@ -363,15 +363,22 @@ int ctf_visitor_type_declarator(FILE *fd, int depth, struct ctf_node *node) if (ret) return ret; } - cds_list_for_each_entry(iter, &node->u.type_declarator.u.nested.length, - siblings) { - if (iter->type != NODE_UNARY_EXPRESSION) { - fprintf(fd, "[error] %s: expecting unary expression as length\n", __func__); + if (!node->u.type_declarator.u.nested.abstract_array) { + cds_list_for_each_entry(iter, &node->u.type_declarator.u.nested.length, + siblings) { + if (iter->type != NODE_UNARY_EXPRESSION) { + fprintf(fd, "[error] %s: expecting unary expression as length\n", __func__); + return -EINVAL; + } + ret = _ctf_visitor_semantic_check(fd, depth + 1, iter); + if (ret) + return ret; + } + } else { + if (node->parent->type == NODE_TYPEALIAS_TARGET) { + fprintf(fd, "[error] %s: abstract array declarator not permitted as target of typealias\n", __func__); return -EINVAL; } - ret = _ctf_visitor_semantic_check(fd, depth + 1, iter); - if (ret) - return ret; } if (node->u.type_declarator.bitfield_len) { ret = _ctf_visitor_semantic_check(fd, depth + 1,