diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/SVals.cpp | 2 | ||||
-rw-r--r-- | clang/test/Analysis/symbol-reaper.c | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/SVals.cpp b/clang/lib/StaticAnalyzer/Core/SVals.cpp index 559ca2c9840..b32be9e82d4 100644 --- a/clang/lib/StaticAnalyzer/Core/SVals.cpp +++ b/clang/lib/StaticAnalyzer/Core/SVals.cpp @@ -85,7 +85,7 @@ const FunctionDecl *SVal::getAsFunctionDecl() const { SymbolRef SVal::getAsLocSymbol(bool IncludeBaseRegions) const { // FIXME: should we consider SymbolRef wrapped in CodeTextRegion? if (Optional<nonloc::LocAsInteger> X = getAs<nonloc::LocAsInteger>()) - return X->getLoc().getAsLocSymbol(); + return X->getLoc().getAsLocSymbol(IncludeBaseRegions); if (Optional<loc::MemRegionVal> X = getAs<loc::MemRegionVal>()) { const MemRegion *R = X->getRegion(); diff --git a/clang/test/Analysis/symbol-reaper.c b/clang/test/Analysis/symbol-reaper.c index a47161bea2e..ef8ff18a2d8 100644 --- a/clang/test/Analysis/symbol-reaper.c +++ b/clang/test/Analysis/symbol-reaper.c @@ -85,8 +85,7 @@ void test_loc_as_integer_element_index_lifetime() { x = (int)&(s->field); ptr = &arr[x]; if (s) {} - // FIXME: Should not warn. The symbol is still alive within the ptr's index. - } while (0); // expected-warning{{SYMBOL DEAD}} + } while (0); } // Test below checks lifetime of SymbolRegionValue in certain conditions. |