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

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 29 11:21:35 PDT 2023


================
@@ -47,6 +50,16 @@ int main(int, char **argv) {
     return *p && 0;
     // CHECK-STACK-LOAD: #0 {{.*}}main{{.*}}misaligned.cpp
 
+  case 'L': {
+    int x;
+    // CHECK-MEMCPY-LOAD: misaligned.cpp:[[#@LINE+4]]{{(:16)?}}: runtime error: load of misaligned address [[PTR:0x[0-9a-f]*]] for type 'const void *', which requires 4 byte alignment
----------------
vitalybuka wrote:

'const void *' is wrong here :(

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


More information about the cfe-commits mailing list