]> granicus.if.org Git - clang/commit
[analyzer] Properly invalidate global regions on opaque function calls.
authorJordan Rose <jordan_rose@apple.com>
Mon, 15 Apr 2013 20:39:41 +0000 (20:39 +0000)
committerJordan Rose <jordan_rose@apple.com>
Mon, 15 Apr 2013 20:39:41 +0000 (20:39 +0000)
commite0208ff84598f48e0aafecf5b543afeff8574045
tree866181b39ad305537d9b2bd26a149b09dffcdc4b
parent9a0b3c2f7c440c53b65bd1b085a7471d9f7ed490
[analyzer] Properly invalidate global regions on opaque function calls.

This fixes a regression where a call to a function we can't reason about
would not actually invalidate global regions that had explicit bindings.

  void test_that_now_works() {
    globalInt = 42;
    clang_analyzer_eval(globalInt == 42); // expected-warning{{TRUE}}

    invalidateGlobals();
    clang_analyzer_eval(globalInt == 42); // expected-warning{{UNKNOWN}}
  }

This has probably been around since the initial "cluster" refactoring of
RegionStore, if not longer.

<rdar://problem/13464044>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179553 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/RegionStore.cpp
test/Analysis/global_region_invalidation.mm