https://bugs.llvm.org/show_bug.cgi?id=45707

Roman Lebedev <lebedev...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |lebedev...@gmail.com
             Status|NEW                         |RESOLVED

--- Comment #1 from Roman Lebedev <lebedev...@gmail.com> ---
> void test() {
>   int *p = (int *)0x101;
>   *p = 2;
> }

That is UB.
int is 4-byte aligned.
If you've got a misaligned pointer, you need to use memcpy to access it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to