exceptions4c
exceptions4c copied to clipboard
SIGXX should be removed from the calling process's signal mask, when catched signal exceptions ?
` int ut_example() {
e4c_using_context(E4C_TRUE) {
int * pointer = NULL;
try {
int oops = *pointer;
}
catch (BadPointerException) {
printf("No problem ;-)");
fflush(stdout);
}
}
}
int main() {
while (true)
{
ut_example();
sleep(5);
}
} `
Output: No problem ;-) Segmentation fault (core dumped)
FIX: Add a line ' sigrelse(signal_number); ' in function '_e4c_library_handle_signal' (e4c.c)