Is it possible to restore the normal execution flow of a C program, after the Segmentation Fault error?
struct A { int x; }; A* a = 0; a->x = 123; /
Call this, and when a segfault will occur, your code will execute segv_handler and then continue back to where it was.
void segv_handler(int) { // Do what you want here } signal(SIGSEGV, segv_handler);