[compiler-rt] -fsanitize=alignment: check memcpy/memmove arguments (PR #67766)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 10:42:41 PDT 2023


MaskRay wrote:

> > @zygoloid Is reusing the message for regular stores clear (current behavior) enough?
> > ```
> > // CHECK-MEMCPY-STORE: misaligned.cpp:[[#@LINE+4]]{{(:12)?}}: runtime error: store to misaligned address [[PTR:0x[0-9a-f]*]] for type 'int *', which requires 4 byte alignment
> > ```
> 
> I predict we'll get a bug report saying "I didn't do a store, I used `memcpy`, which is specified as doing a byte-by-byte copy". But given that improving this would require adding a new entry point into the runtime library, and we don't know how common or rare this situation will be, I think it's probably OK to wait until someone complains.

Thanks. Let's wait until someone complains :)

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


More information about the llvm-commits mailing list