Skip to content

Commit c75a21a

Browse files
committed
[cppia] Fix throw/catch of seg faults in tests
The host must be compiled with HXCPP_CATCH_SEGV so that seg faults are handled as hxcpp exceptions.
1 parent 1333ad5 commit c75a21a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

test/cppia/LocalFunctionExceptions.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class LocalFunctionExceptions {
7777

7878
try {
7979
localFunction();
80-
} catch (e:String) {
80+
} catch (e:Dynamic) {
8181
if (e == 'Thrown from static') {
8282
return Ok;
8383
} else {
@@ -95,7 +95,7 @@ class LocalFunctionExceptions {
9595

9696
try {
9797
localFunction();
98-
} catch (e:String) {
98+
} catch (e:Dynamic) {
9999
if (e == 'Thrown from static') {
100100
return Ok;
101101
} else {
@@ -113,7 +113,7 @@ class LocalFunctionExceptions {
113113

114114
try {
115115
localFunction();
116-
} catch (e:String) {
116+
} catch (e:Dynamic) {
117117
if (e == 'Thrown from static') {
118118
return Ok;
119119
} else {

test/cppia/compile-host.hxml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
-D dll_export=host_classes.info
44
-L utest
55
--dce no
6-
--cpp bin
6+
--cpp bin
7+
-D HXCPP_CATCH_SEGV

0 commit comments

Comments
 (0)