diff options
author | Erich Keane <erich.keane@intel.com> | 2017-12-14 23:37:08 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-12-14 23:37:08 +0000 |
commit | 47475f9ec7d35aa04ce3a18e08fea3c6e1ed0074 (patch) | |
tree | 60729aa5426b65464d2db59060dab94bc126526f /clang/lib/AST/TypeLoc.cpp | |
parent | 3c85a155c1edf7e83fd33d439468e48829ce7daa (diff) |
Correct UnaryTransformTypeLoc to properly initialize.
The initializeLocal function of UnaryTransformTypeLoc missed
the UnderlyingTInfo member. This caused a null-dereference
issue, as reported in PR23421. This patch correctly initializss
the UnderlyingTInfo.
llvm-svn: 320765
Diffstat (limited to 'clang/lib/AST/TypeLoc.cpp')
-rw-r--r-- | clang/lib/AST/TypeLoc.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/TypeLoc.cpp b/clang/lib/AST/TypeLoc.cpp index 6e18fe25fcb5..b05c5fc68096 100644 --- a/clang/lib/AST/TypeLoc.cpp +++ b/clang/lib/AST/TypeLoc.cpp @@ -444,6 +444,15 @@ void TypeOfTypeLoc::initializeLocal(ASTContext &Context, getUnderlyingType(), Loc); } +void UnaryTransformTypeLoc::initializeLocal(ASTContext &Context, + SourceLocation Loc) { + setKWLoc(Loc); + setRParenLoc(Loc); + setLParenLoc(Loc); + this->setUnderlyingTInfo( + Context.getTrivialTypeSourceInfo(getTypePtr()->getBaseType(), Loc)); +} + void ElaboratedTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) { setElaboratedKeywordLoc(Loc); |