From d0028dcb86e2834755d84f064dcefb81ab31ec19 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 29 Mar 2015 16:42:06 +0000 Subject: [parser] Push _Atomic locs through DeclaratorChunk. Otherwise it stays uninitialized with potentially catastrophic results. Found by afl-fuzz. llvm-svn: 233494 --- clang/include/clang/Sema/DeclSpec.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/include') diff --git a/clang/include/clang/Sema/DeclSpec.h b/clang/include/clang/Sema/DeclSpec.h index 03c3427d68b..de39d83bded 100644 --- a/clang/include/clang/Sema/DeclSpec.h +++ b/clang/include/clang/Sema/DeclSpec.h @@ -1415,7 +1415,8 @@ struct DeclaratorChunk { static DeclaratorChunk getPointer(unsigned TypeQuals, SourceLocation Loc, SourceLocation ConstQualLoc, SourceLocation VolatileQualLoc, - SourceLocation RestrictQualLoc) { + SourceLocation RestrictQualLoc, + SourceLocation AtomicQualLoc) { DeclaratorChunk I; I.Kind = Pointer; I.Loc = Loc; @@ -1423,6 +1424,7 @@ struct DeclaratorChunk { I.Ptr.ConstQualLoc = ConstQualLoc.getRawEncoding(); I.Ptr.VolatileQualLoc = VolatileQualLoc.getRawEncoding(); I.Ptr.RestrictQualLoc = RestrictQualLoc.getRawEncoding(); + I.Ptr.AtomicQualLoc = AtomicQualLoc.getRawEncoding(); I.Ptr.AttrList = nullptr; return I; } -- cgit v1.2.3