]> granicus.if.org Git - clang/commit
[PCH] Fix a PCH serialization crash, with invalid code related to forward enum refere...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 7 Aug 2013 21:17:33 +0000 (21:17 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 7 Aug 2013 21:17:33 +0000 (21:17 +0000)
commit51e75aecf4fb303b91c9e54fd88e3509e5acc7a6
tree09432ec14773d901a2de11bc13edc1267e547683
parentd3a247cc4e136af6b71dc5968ca6190e6c68f4c5
[PCH] Fix a PCH serialization crash, with invalid code related to forward enum references.

The problem was that an enum without closing semicolon could be associated as a forward enum
in an erroneous declaration, leading to the identifier being associated with the enum decl but
without a declaration actually referencing it.
This resulted in not having it serialized before serializing the identifier that is associated with.

Also prevent the ASTUnit from querying the serialized DeclID for an invalid top-level decl; it may not
have been serialized.

rdar://14539667

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187914 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/ASTUnit.cpp
lib/Serialization/ASTWriter.cpp
test/Index/Inputs/preamble-with-error.h [new file with mode: 0644]
test/Index/pch-with-errors.m
test/Index/preamble.c