]> granicus.if.org Git - clang/commit
[analyzer] Fix handling of labels in getLValueElement
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 23 Oct 2017 23:46:06 +0000 (23:46 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 23 Oct 2017 23:46:06 +0000 (23:46 +0000)
commit117339c38e266bf28c69d0bf29d35cb5ca79e2d8
tree1f9b30a713a1cc9423deba0f666b3c654b64ef87
parentb1ead8ba0f35dc3bf852be933dc2fe123fefa2ea
[analyzer] Fix handling of labels in getLValueElement

In getLValueElement Base may represent the address of a label
(as in the newly-added test case), in this case it's not a loc::MemRegionVal
and Base.castAs<loc::MemRegionVal>() triggers an assert, this diff makes
getLValueElement return UnknownVal instead.

Differential revision: https://reviews.llvm.org/D39174

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316399 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/Store.cpp
test/Analysis/ptr-arith.c