[PATCH] [analyzer][Bugfix] RegionStore: use pointee type to create one-element regions
Ted Kremenek
kremenek at apple.com
Tue Aug 19 12:02:41 PDT 2014
Can you please provide a test case that shows what problem this fixed?
> On Aug 19, 2014, at 10:50 AM, Aleksei Sidorin <a.sidorin at samsung.com> wrote:
>
> Hi zaks.anna, jordan_rose, krememek,
>
> This patch fixes an issue that makes analyzer to create additional symbols for pointer variables (binding is not recognized even if it exists).
>
> http://reviews.llvm.org/D4974
>
> Files:
> lib/StaticAnalyzer/Core/RegionStore.cpp
>
> Index: lib/StaticAnalyzer/Core/RegionStore.cpp
> ===================================================================
> --- lib/StaticAnalyzer/Core/RegionStore.cpp
> +++ lib/StaticAnalyzer/Core/RegionStore.cpp
> @@ -1282,6 +1282,8 @@
> const SymbolicRegion *SR = cast<SymbolicRegion>(MR);
> T = SR->getSymbol()->getType();
> }
> + if (T->isAnyPointerType() || T->isReferenceType())
> + T = T->getPointeeType();
> }
> MR = GetElementZeroRegion(MR, T);
> }
> <D4974.12671.patch>
More information about the cfe-commits
mailing list