about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-27 06:21:53 +0000
committerbors <bors@rust-lang.org>2022-01-27 06:21:53 +0000
commit21b4a9cfdcbb1e76f4b36b5c3cfd64d627285093 (patch)
tree1aa423dc76c9242d2b2b2362307b50516fcf1b1f /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent563250a65c884c6767dc2ee2e2580360d33d561c (diff)
parent10b722cc79c52a242d8671243b46e0319296cb30 (diff)
downloadrust-21b4a9cfdcbb1e76f4b36b5c3cfd64d627285093.tar.gz
rust-21b4a9cfdcbb1e76f4b36b5c3cfd64d627285093.zip
Auto merge of #92889 - tmiasko:unbounded-recursion, r=ecstatic-morse
Ignore unwinding edges when checking for unconditional recursion

The unconditional recursion lint determines if all execution paths
eventually lead to a self-recursive call.

The implementation always follows unwinding edges which limits its
practical utility. For example, it would not lint function `f` because a
call to `g` might unwind. It also wouldn't lint function `h` because an
overflow check preceding the self-recursive call might unwind:

```rust
pub fn f() {
    g();
    f();
}

pub fn g() { /* ... */ }

pub fn h(a: usize) {
  h(a + 1);
}
```

To avoid the issue, assume that terminators that might continue
execution along non-unwinding edges do so.

Fixes #78474.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions