]> granicus.if.org Git - clang/commitdiff
In the latest episode of "Deserializing bugs caused by accessors" the series reached...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 3 Jan 2011 17:57:40 +0000 (17:57 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 3 Jan 2011 17:57:40 +0000 (17:57 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122756 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReaderDecl.cpp

index f2183ea695f84c8e30b6c2d7bbaccc41efd4abf0..40f3ab7e1b1101b93359709dc5f9adf4c66e2329 100644 (file)
@@ -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++];