X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fmetadata%2Fctf-visitor-semantic-validator.c;h=6f46bfbdf5df6d342cef56ad3bb6892fd813619d;hb=7d4192cb80178ad534e460d56f67e55679c7d8ee;hp=da77f596733bad47249a0648bd73a819a1c6c50c;hpb=fd55fc57942d179105ddda100a5341f9aacdf5c0;p=babeltrace.git diff --git a/formats/ctf/metadata/ctf-visitor-semantic-validator.c b/formats/ctf/metadata/ctf-visitor-semantic-validator.c index da77f596..6f46bfbd 100644 --- a/formats/ctf/metadata/ctf-visitor-semantic-validator.c +++ b/formats/ctf/metadata/ctf-visitor-semantic-validator.c @@ -292,17 +292,25 @@ int ctf_visitor_type_declarator(FILE *fd, int depth, struct ctf_node *node) case TYPEDEC_ID: break; case TYPEDEC_NESTED: + { + int nr_nest_len; + if (node->u.type_declarator.u.nested.type_declarator) { ret = _ctf_visitor_semantic_check(fd, depth + 1, node->u.type_declarator.u.nested.type_declarator); if (ret) return ret; } - if (node->u.type_declarator.u.nested.length) { + cds_list_for_each_entry(iter, &node->u.type_declarator.u.nested.length, + siblings) { ret = _ctf_visitor_semantic_check(fd, depth + 1, - node->u.type_declarator.u.nested.length); + iter); if (ret) return ret; + nr_nest_len++; + if (iter->type == NODE_UNARY_EXPRESSION && nr_nest_len > 1) { + goto errperm; + } } if (node->u.type_declarator.bitfield_len) { ret = _ctf_visitor_semantic_check(fd, depth + 1, @@ -311,6 +319,7 @@ int ctf_visitor_type_declarator(FILE *fd, int depth, struct ctf_node *node) return ret; } break; + } case TYPEDEC_UNKNOWN: default: fprintf(fd, "[error] %s: unknown type declarator %d\n", __func__, @@ -810,8 +819,9 @@ int _ctf_visitor_semantic_check(FILE *fd, int depth, struct ctf_node *node) } depth++; - if (node->u._enum.container_type) { - ret = _ctf_visitor_semantic_check(fd, depth + 1, node->u._enum.container_type); + cds_list_for_each_entry(iter, &node->u._enum.container_type, + siblings) { + ret = _ctf_visitor_semantic_check(fd, depth + 1, iter); if (ret) return ret; }