diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-03 17:57:40 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-03 17:57:40 +0000 |
commit | 7cd69249fa0d4b55da0731e451940caa17711af1 (patch) | |
tree | 3337a8557c077826dab1c031965429aacc6635d8 /clang/lib | |
parent | 540960f4a28c45079c2f9bddc23ec3bff808b45b (diff) | |
download | bcm5719-llvm-7cd69249fa0d4b55da0731e451940caa17711af1.tar.gz bcm5719-llvm-7cd69249fa0d4b55da0731e451940caa17711af1.zip |
In the latest episode of "Deserializing bugs caused by accessors" the series reached a thrilling climax when
FunctionDecl::setPure crashed a poor user's code.
Remove the use of this accessor when deserializing, along with several other in the neighborhood. Fixes rdar://8759653.
llvm-svn: 122756
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index f2183ea695f..40f3ab7e1b1 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -385,17 +385,17 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { // after everything else is read. FD->SClass = (StorageClass)Record[Idx++]; - FD->setStorageClassAsWritten((StorageClass)Record[Idx++]); + FD->SClassAsWritten = (StorageClass)Record[Idx++]; FD->IsInline = Record[Idx++]; FD->IsInlineSpecified = Record[Idx++]; - FD->setVirtualAsWritten(Record[Idx++]); - FD->setPure(Record[Idx++]); - FD->setHasInheritedPrototype(Record[Idx++]); - FD->setHasWrittenPrototype(Record[Idx++]); - FD->setDeleted(Record[Idx++]); - FD->setTrivial(Record[Idx++]); - FD->setHasImplicitReturnZero(Record[Idx++]); - FD->setLocEnd(ReadSourceLocation(Record, Idx)); + FD->IsVirtualAsWritten = Record[Idx++]; + FD->IsPure = Record[Idx++]; + FD->HasInheritedPrototype = Record[Idx++]; + FD->HasWrittenPrototype = Record[Idx++]; + FD->IsDeleted = Record[Idx++]; + FD->IsTrivial = Record[Idx++]; + FD->HasImplicitReturnZero = Record[Idx++]; + FD->EndRangeLoc = ReadSourceLocation(Record, Idx); // Read in the parameters. unsigned NumParams = Record[Idx++]; |