ASTReader: Copy input file offset data to avoid unaligned accesses
authorJustin Bogner <mail@justinbogner.com>
Sat, 20 Jun 2015 22:31:04 +0000 (22:31 +0000)
committerJustin Bogner <mail@justinbogner.com>
Sat, 20 Jun 2015 22:31:04 +0000 (22:31 +0000)
commit2172c3a3c84ed86d7e0e02347f92582a03288f17
tree94948c2e5b5ad1149c9ccbacf06d008ef91f406f
parentdb8ef097be8000fecab112588b8b391aeb6e8527
ASTReader: Copy input file offset data to avoid unaligned accesses

We interpret Blob as an array of uint64_t here, but there's no reason
to think that it has suitable alignment. Instead, read the data in in
an alignment-safe way and store it in a std::vector.

This fixes 225 test failures when clang is built with ubsan.

llvm-svn: 240228
clang/include/clang/Serialization/Module.h
clang/lib/Serialization/ASTReader.cpp