[clang] [Clang] Fix __builtin_dynamic_object_size off by 4 (PR #111015)

Jan Hendrik Farr via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 13:17:02 PDT 2024


Cydox wrote:

> My default stance would be that gcc and the Linux code in question are wrong. We could reconsider if strict checking is impractical for Linux, but I'd expect kernel devs to prefer catching accesses one past the end of the array.

If you access the array none of this really matters, as you wouldn't be dealing with `__builtin_dynamic_object_size(acl, 0)`, but instead `__builtin_dynamic_object_size(acl->a_entries, 0)`, which with this fix still computes count multiplied with the size of an array element.



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


More information about the cfe-commits mailing list