mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-09 15:55:37 +00:00
stack_overflow.rs cover up bug?
This commit is contained in:
parent
4cdb377855
commit
816ab161fc
1 changed files with 4 additions and 4 deletions
|
@ -20,11 +20,11 @@ fn main() -> ! {
|
|||
|
||||
#[inline(never)]
|
||||
fn spam() {
|
||||
// allocate and initialize one kilobyte of stack memory to provoke stack overflow quicker
|
||||
let use_stack = [0xAA; 1024];
|
||||
let addr = &use_stack as *const i32;
|
||||
// allocate and initialize one kilobyte of stack memory to provoke stack overflow
|
||||
let use_stack = [0xAA_u32; 1024];
|
||||
|
||||
log::info!("address of current `use_stack`: {:?}", addr);
|
||||
log::info!("address of current `use_stack`: {:?}", &use_stack as *const u32);
|
||||
|
||||
log::info!("entering next recursive step");
|
||||
spam(); // infinite recursion
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue