exceptions4c icon indicating copy to clipboard operation
exceptions4c copied to clipboard

Signal is not handled twice with a specific order of headers.

Open hadichahine opened this issue 4 years ago • 0 comments

Consider the following program:

#include "e4c.h"
#include <stdio.h>
#include <stdlib.h>

void run(){
	e4c_using_context(E4C_TRUE){
		try{
			int *s = NULL;
			*s = 0;
		}catch(BadPointerException){
			printf("signal handled\n");
		}
	}
}

void main(){
	run();
	run();
}

The first signal is handled while the second is not. It crashes the program with SIGSEGV. This also happens in the case of ArithemticException (dividing by zero for instance). Place "e4c.h" after the standard headers and the program works as it should do.

hadichahine avatar Apr 16 '20 14:04 hadichahine