Skip to content
Commit 7df0f0b4 authored by ziqingluo-90's avatar ziqingluo-90
Browse files

[clang-tidy] Fixing a bug in `InfiniteLoopCheck` that raises false alarms on finite loops

A loop can recursively increase/decrease a function local static
variable and make itself finite.  For example,

```
void f() {
  static int i = 0;
  i++;
  while (i < 10)
     f();
}

```

Such cases are not considered by `InfiniteLoopCheck`.  This commit
fixes this problem by detecting usages of static local variables
and recursions.

Reviewed by: NoQ, njames93
Differential Revision: https://reviews.llvm.org/D128401
parent beacf9bd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment