[clang] [Clang][counted_by] Don't treat a __bdos argument as an array if it isn't (PR #125298)
Nathan Chancellor via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 31 15:06:29 PST 2025
nathanchance wrote:
This tentatively looks good to me. Do you need a reduced test case for this? `cvise` gave me:
```c
typedef struct {
char __padding[0];
} spinlock_t;
struct {
int priv_len;
spinlock_t addr_list_lock;
char *dev_addr;
char priv[] __attribute__((__counted_by__(priv_len)));
} falcon_reconfigure_xmac_core_efx;
void falcon_reconfigure_xmac_core() {
long __q_size_field = __builtin_dynamic_object_size(
&falcon_reconfigure_xmac_core_efx.dev_addr[4], 1);
_Bool __ret_do_once = __q_size_field, __ret_cond = __ret_do_once;
static _Bool __already_done;
__ret_cond &&__already_done;
}
```
https://github.com/llvm/llvm-project/pull/125298
More information about the cfe-commits
mailing list