I export a function from d to c++ with extern(C++). The d code has a try catch statement on the highest level.Whenever the d code throws a exception the program aborts. I have c++ objects on the call stack and call the function in d. Then there is the d try catch statement and then the d exception throw. The d code:
extern (C++) void ThrowEx() {
try {
throw new Exception("hello");
} catch (Exception ex) {
}
}
The c++ code:
extern "C" int rt_init();
void ThrowEx();
void func() {
rt_init();
ThrowEx();
}
When I change ThrowEx to not throw an exception everything works as expected. The d code gets executed and no error occurs.
When the program crashes the following output is generated:
dwarfeh(224) fatal error
uncaught exception
Comment #1 by destructionator — 2016-05-23T00:01:31Z
This actually works for me.. what are some other details of your setup?
Comment #2 by robert.schadek — 2024-12-07T13:36:35Z