Skip to content

Commit 4936e8a

Browse files
committed
[software] Jump to _eoc on abort
1 parent 32133b8 commit 4936e8a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

software/runtime/kmp/cppsupport.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ extern "C" {
1313
#include "runtime.h"
1414
}
1515

16+
extern void (*_eoc)(void);
17+
1618
kmp::Mutex allocLock;
1719

1820
void *operator new(size_t size) {
@@ -40,13 +42,16 @@ void __throw_length_error(const char *msg) {
4042
abort();
4143
}
4244

43-
void __throw_bad_optional_access() { printf("Bad optional access\n"); }
45+
void __throw_bad_optional_access() {
46+
printf("Bad optional access\n");
47+
abort();
48+
}
4449
} // namespace std
4550

4651
extern "C" void abort() {
4752
printf("Aborting\n");
4853
while (true) {
49-
mempool_wfi();
54+
asm("j _eoc");
5055
}
5156
}
5257

0 commit comments

Comments
 (0)