kees wrote: Thanks! The update fixes the anon struct issue I hit. I've found one more issue, though this appears to be a miscalculation with a pathological `count` value (i.e. `count` is signed type and contains a negative value):
``` struct annotated { unsigned long flags; int count; int array __counted_by(count); }; static struct annotated * noinline alloc_annotated(int index) { struct annotated *p; p = malloc(sizeof(*p) + index * sizeof(*p->array)); p->count = index; return p; } ... struct annotated *a; c = alloc_annotated(index); c->count = -1; printf("%zu\n", __builtin_dynamic_object_size(p->array, 1)); ``` This prints a wrapped calculation instead of the expected "0". https://github.com/llvm/llvm-project/pull/76348 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits