[llvm] [llvm] Fix __builtin_object_size interaction between Negative Offset … (PR #111827)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 00:01:05 PDT 2024


serge-sans-paille wrote:

> ```c++
> #include <stdio.h>
> int x;
> int main(void) {
>   int array1[4] = {0};
>   int array2[4] = {0};
>   int *ptr;
>   if (x) {
>     ptr = array1;
>   } else {
>     ptr = array2;
>   }
>   printf("%zu\n", __builtin_object_size(ptr, 3));
> }
> ```

I'll have a look to that caching issue.

For the other example, LLVM doesn't seem to support Type=3, see

https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGBuiltin.cpp#L1122


https://github.com/llvm/llvm-project/pull/111827


More information about the llvm-commits mailing list