diff options
author | Anna Zaks <ganna@apple.com> | 2013-11-20 00:11:42 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-11-20 00:11:42 +0000 |
commit | d2a807d8317c4782aafd9186852e9b7eed76a111 (patch) | |
tree | 057ec750a95d586071ac3f3b47f6a8f1abf5d435 /clang/test | |
parent | 0d3f7eca8e552621c61658a5f895e2716d5c0e74 (diff) | |
download | bcm5719-llvm-d2a807d8317c4782aafd9186852e9b7eed76a111.tar.gz bcm5719-llvm-d2a807d8317c4782aafd9186852e9b7eed76a111.zip |
[analyzer] Fix an infinite recursion in region invalidation by adding block count to the BlockDataRegion.
llvm-svn: 195174
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/blocks.m | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Analysis/blocks.m b/clang/test/Analysis/blocks.m index 6d3495cd523..62d53607b53 100644 --- a/clang/test/Analysis/blocks.m +++ b/clang/test/Analysis/blocks.m @@ -146,3 +146,19 @@ void testReturnVariousSignatures() { return 42; }(); } + +// This test used to cause infinite loop in the region invalidation. +void blockCapturesItselfInTheLoop(int x, int m) { + void (^assignData)(int) = ^(int x){ + x++; + }; + while (m < 0) { + void (^loop)(int); + loop = ^(int x) { + assignData(x); + }; + assignData = loop; + m++; + } + assignData(x); +} |