]> granicus.if.org Git - clang/commit
[analyzer] Fix memory space of static locals seen from nested blocks.
authorArtem Dergachev <artem.dergachev@gmail.com>
Mon, 23 Jan 2017 16:57:11 +0000 (16:57 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Mon, 23 Jan 2017 16:57:11 +0000 (16:57 +0000)
commitcdd3dc424acc3ead5479b6bcc014f09549896ef3
tree19f954e983cba6f7b918957e6a1b284441a309fe
parent0d4270e1a190919ea5655d41f38f8fbbf15fc915
[analyzer] Fix memory space of static locals seen from nested blocks.

When a block within a function accesses a function's static local variable,
this local is captured by reference rather than copied to the heap.

Therefore this variable's memory space is known: StaticGlobalSpaceRegion.
Used to be UnknownSpaceRegion, same as for stack locals.

Fixes a false positive in MacOSXAPIChecker.

rdar://problem/30105546
Differential revision: https://reviews.llvm.org/D28946

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292800 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/MemRegion.cpp
test/Analysis/dispatch-once.m