diff options
| author | Jordan Rose <jordan_rose@apple.com> | 2013-07-17 17:16:38 +0000 |
|---|---|---|
| committer | Jordan Rose <jordan_rose@apple.com> | 2013-07-17 17:16:38 +0000 |
| commit | df70700f5aa5744d7f70fb3e6610ff434f643a71 (patch) | |
| tree | 974625618e869e57c6d7d033936efeff84dc04f9 /lib/StaticAnalyzer/Core/RegionStore.cpp | |
| parent | be2e1b11e3350e3a6e632c71beaab83aae3824d2 (diff) | |
| download | clang-df70700f5aa5744d7f70fb3e6610ff434f643a71.tar.gz clang-df70700f5aa5744d7f70fb3e6610ff434f643a71.tar.bz2 clang-df70700f5aa5744d7f70fb3e6610ff434f643a71.tar.xz | |
[analyzer] Handle C string default values for const char * arguments.
Previously, SValBuilder knew how to evaluate StringLiterals, but couldn't
handle an array-to-pointer decay for constant values. Additionally,
RegionStore was being too strict about loading from an array, refusing to
return a 'char' value from a 'const char' array. Both of these have been
fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RegionStore.cpp')
| -rw-r--r-- | lib/StaticAnalyzer/Core/RegionStore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index 00a6f71190..2a3319bc04 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -1497,7 +1497,7 @@ SVal RegionStoreManager::getBindingForElement(RegionBindingsConstRef B, // FIXME: Handle loads from strings where the literal is treated as // an integer, e.g., *((unsigned int*)"hello") QualType T = Ctx.getAsArrayType(StrR->getValueType())->getElementType(); - if (T != Ctx.getCanonicalType(R->getElementType())) + if (!Ctx.hasSameUnqualifiedType(T, R->getElementType())) return UnknownVal(); const StringLiteral *Str = StrR->getStringLiteral(); |
