diff --git a/tests/stack_overflow.rs b/tests/stack_overflow.rs index af2538a..2aa23cc 100644 --- a/tests/stack_overflow.rs +++ b/tests/stack_overflow.rs @@ -20,12 +20,6 @@ pub extern "C" fn _start() -> ! { panic!("Execution continued after stack overflow"); } -#[allow(unconditional_recursion)] -fn stack_overflow() { - stack_overflow(); // for each recursion, the return address is pushed - volatile::Volatile::new(0).read(); // prevent tail recursion optimizations -} - #[panic_handler] fn panic(info: &PanicInfo) -> ! { amix::test_panic_handler(info) @@ -56,3 +50,9 @@ extern "x86-interrupt" fn test_double_fault_handler( exit_qemu(QemuExitCode::Success); loop {} } + +#[allow(unconditional_recursion)] +fn stack_overflow() { + stack_overflow(); // for each recursion, the return address is pushed + volatile::Volatile::new(0).read(); // prevent tail recursion optimizations +}