[analyzer] Use lazily created buffer in EmptyLocalizationContextChecker
authorDevin Coughlin <dcoughlin@apple.com>
Tue, 30 Aug 2016 23:07:14 +0000 (23:07 +0000)
committerDevin Coughlin <dcoughlin@apple.com>
Tue, 30 Aug 2016 23:07:14 +0000 (23:07 +0000)
commit184996bbb4b82ad947507365e55afc5bcca4836d
tree27ea95274227da55f6ca6dc1a27c6f1a9b5e994e
parentf6275a08ef01f39b7a7c788657c7e1c34013fe9e
[analyzer] Use lazily created buffer in EmptyLocalizationContextChecker

Fix a crash when relexing the underlying memory buffer to find incorrect
arguments to NSLocalizedString(). With precompiled headers, the raw
buffer may be NULL. Instead, use the source manager to get the buffer,
which will lazily create the buffer for precompiled headers.

rdar://problem/27429091

llvm-svn: 280174
clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp
clang/test/Analysis/Inputs/localization-pch.h [new file with mode: 0644]
clang/test/Analysis/localization-aggressive.m