[clang] Fix an uint32_t overflow in large preamble.
authorHaojian Wu <hokein.wu@gmail.com>
Tue, 5 May 2020 07:26:12 +0000 (09:26 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 5 May 2020 08:36:34 +0000 (10:36 +0200)
commit4f8d9722b4992272c0e1b33d57fc20bbd93269af
tree75c416d95cd8eb8a5f605c9169475701f9fcea21
parentb79751e83d7e50aa897049e9831dff840926d368
[clang] Fix an uint32_t overflow in large preamble.

Summary:
I was surprised to see the LocalOffset can exceed uint32_t, but it
does happen and lead to crashes in one of our internal huge TU with a large
preamble.

with this patch, the crash is gone.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D79397
clang/include/clang/Serialization/ASTReader.h
clang/include/clang/Serialization/ASTRecordReader.h
clang/lib/Serialization/ASTReaderDecl.cpp