From 225c62bf31d38471c475cef74aa92c39d18f50e9 Mon Sep 17 00:00:00 2001 From: ami-chuu Date: Tue, 31 Mar 2026 00:58:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20tests/stack=5Foverflow.rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/stack_overflow.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 +}