rcore-tutorial/user/src/bin/stack_overflow.rs

17 lines
No EOL
229 B
Rust

#![no_std]
#![no_main]
#[macro_use]
extern crate user_lib;
fn f(d: usize) {
println!("d = {}",d);
f(d + 1);
}
#[no_mangle]
pub fn main() -> i32 {
println!("It should trigger segmentation fault!");
f(0);
0
}