Re: HELP: one issue during the implementation for counted_by attribute

2023-12-06 Thread Qing Zhao
Just an update on this issue. Finally, I resolved this issue with the following solution: For the source code (portion): " struct annotated { size_t foo; char array[] __attribute__((counted_by (foo))); }; p2->array[8] = 0; “ C FE will generate the following: (*.005t.original)

HELP: one issue during the implementation for counted_by attribute

2023-11-30 Thread Qing Zhao
Hi, 1. For the following source code (portion): struct annotated { size_t foo; char b; char array[] __attribute__((counted_by (foo))); }; static void noinline bar () { struct annotated *p2 = alloc_buf (10); p2->array[8] = 0; return; } 2. I modified C FE to generate the following