]> granicus.if.org Git - clang/commitdiff
When building source location information for an _Atomic type, be sure
authorDouglas Gregor <dgregor@apple.com>
Sun, 9 Oct 2011 18:45:17 +0000 (18:45 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 9 Oct 2011 18:45:17 +0000 (18:45 +0000)
to fill in the source locations for the underlying value type. Fixes
an intermittent crasher (due to uninitialized data) in the PCH test
for _Atomic types.

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

lib/Sema/SemaType.cpp

index 1e0c2d60c4a3122b533fb99e8d8026fbaa99b3ce..154b2a83f991f01dbfd693c45695cadbda667976 100644 (file)
@@ -2885,6 +2885,10 @@ namespace {
     void VisitAtomicTypeLoc(AtomicTypeLoc TL) {
       TL.setKWLoc(DS.getTypeSpecTypeLoc());
       TL.setParensRange(DS.getTypeofParensRange());
+      
+      TypeSourceInfo *TInfo = 0;
+      Sema::GetTypeFromParser(DS.getRepAsType(), &TInfo);
+      TL.getValueLoc().initializeFullCopy(TInfo->getTypeLoc());
     }
 
     void VisitTypeLoc(TypeLoc TL) {