rcore-tutorial/user/src/bin/stack_overflow.rs
2022-01-22 12:40:54 -08:00

17 lines
231 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
}