﻿# V7040\. Infinite recursion detected\.

The analyzer has detected infinite recursion, which will lead to a stack overflow\. The exit condition may have been omitted, or the wrong function may have been called\.

The example:

```cpp
function process(element, condition) {
    const [el, cond] = handle(element, condition)
    const res = process(el, cond)
    ....
}
```

This recursive function does not check the exit condition\. To fix this, add a check on the `cond` condition\.

The fixed code:

```cpp
function process(element, condition) {
    const [el, cond] = handle(element, condition)
    if (cond) {
        const res = process(el, cond)
        ....
    }
}
```