We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c603d9 commit 59e5b64Copy full SHA for 59e5b64
examples/versatileab/src/bin/abt-exception.rs
@@ -78,9 +78,8 @@ unsafe extern "C" fn _abort_handler(_addr: u32) {
78
println!("DFAR (Faulting Address Register): {:?}", dfar);
79
enable_alignment_check();
80
// For the first iteration, we do a regular exception return, which should
81
- // trigger the exception again.
82
- let counter_val = COUNTER.fetch_add(1, core::sync::atomic::Ordering::Relaxed) + 1;
83
- if counter_val == 2 {
+ // trigger the exception again. The second time around we quit.
+ if COUNTER.fetch_add(1, core::sync::atomic::Ordering::Relaxed) == 1 {
84
semihosting::process::exit(0);
85
}
86
0 commit comments