Update stack_overflow

This commit is contained in:
Yifan Wu 2022-11-29 11:14:51 +08:00
parent f6214968c8
commit 3fba081487

View file

@ -4,9 +4,12 @@
#[macro_use] #[macro_use]
extern crate user_lib; extern crate user_lib;
fn f(d: usize) { #[allow(unconditional_recursion)]
println!("d = {}", d); fn f(depth: usize) {
f(d + 1); if depth % 10 == 0 {
println!("depth = {}", depth);
}
f(depth + 1);
} }
#[no_mangle] #[no_mangle]