Skip to content

Commit 66d06b0

Browse files
Call std::terminate on pure or deleted virtual functions
These are special functions that are presumably put into vtables for deleted or pure virtual functions. Previously, this would call `abort()` directly, but calling `std::terminate()` achieves the same effect, but allows user code to change the behavior (e.g. to print to serial, blink leds or whatever makes sense).
1 parent b8c6c85 commit 66d06b0

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

cores/arduino/abi.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,9 @@ namespace std {
2828
}
2929

3030
void __cxa_pure_virtual(void) {
31-
// We might want to write some diagnostics to uart in this case
32-
//std::terminate();
33-
abort();
31+
std::terminate();
3432
}
3533

3634
void __cxa_deleted_virtual(void) {
37-
// We might want to write some diagnostics to uart in this case
38-
//std::terminate();
39-
abort();
35+
std::terminate();
4036
}
41-

0 commit comments

Comments
 (0)