[PATCH] D44576: [clangd] Fix undefined behavior due to misaligned type cast

2018-03-20 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple added a comment. I commited the patch but forgot to quote this review. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@327902 91177308-0d34-0410-b5e6-96231b3b80d8 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44576

[PATCH] D44576: [clangd] Fix undefined behavior due to misaligned type cast

2018-03-16 Thread Jan Korous via Phabricator via cfe-commits
jkorous-apple created this revision. jkorous-apple added a project: clang-tools-extra. Herald added subscribers: cfe-commits, ioeric, ilya-biryukov. The current code is casting pointer to a misaligned type which is undefined behavior. Found by compiling with Undefined Behavior Sanitizer and