]> granicus.if.org Git - clang/commit
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)
commitdc43eb3e96c88c8be7ff866ed28048f6e8c450a8
tree111f359a55e247f5383344313f5b38148acdcaed
parent5f4be954a1f0162dccc9c82b8001930d5de7607c
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240228 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Serialization/Module.h
lib/Serialization/ASTReader.cpp