Merge pull request #818 from phil-opp/post-06-prevent-tail-recursion

Do a volatile read in stack_overflow test to avoid tail recursion
This commit is contained in:
Philipp Oppermann
2020-06-08 12:29:58 +02:00
committed by GitHub

View File

@@ -23,6 +23,7 @@ pub extern "C" fn _start() -> ! {
#[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
}
lazy_static! {