summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-07-08 18:32:26 +0000
committerJustin Bogner <mail@justinbogner.com>2015-07-08 18:32:26 +0000
commit25bf8cb3c0e3c41231289a6ff0a37b6d49b24011 (patch)
tree843534e70c89f9abb5e27e728ca80a251ed8b62e /clang/lib/AST
parent338635389ffed7db4c89b3076280673f71d5d5ae (diff)
downloadbcm5719-llvm-25bf8cb3c0e3c41231289a6ff0a37b6d49b24011.tar.gz
bcm5719-llvm-25bf8cb3c0e3c41231289a6ff0a37b6d49b24011.zip
AST: Avoid reading an unitialized value
Desugar doesn't necessarily initialize ShouldAKA, but as of r241542 it may read it. Fix the misuse of the API and initialize this before passing it in. Found by ubsan. llvm-svn: 241705
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTDiagnostic.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index 68a58a517df..dddaa5af6fb 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -192,8 +192,8 @@ ConvertTypeToDiagnosticString(ASTContext &Context, QualType Ty,
if (CompareCanTy == CanTy)
continue; // Same canonical types
std::string CompareS = CompareTy.getAsString(Context.getPrintingPolicy());
- bool aka;
- QualType CompareDesugar = Desugar(Context, CompareTy, aka);
+ bool ShouldAKA = false;
+ QualType CompareDesugar = Desugar(Context, CompareTy, ShouldAKA);
std::string CompareDesugarStr =
CompareDesugar.getAsString(Context.getPrintingPolicy());
if (CompareS != S && CompareDesugarStr != S)
OpenPOWER on IntegriCloud