Skip to content

Commit d89dbe8

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
1 parent 3146d57 commit d89dbe8

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

libcxxabi/test/forced_unwind2.pass.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ struct Stop<R (*)(Args...)> {
4343
}
4444
};
4545

46+
static void cleanup(_Unwind_Reason_Code, struct _Unwind_Exception* exc) {
47+
delete exc;
48+
}
49+
4650
static void forced_unwind() {
4751
_Unwind_Exception* exc = new _Unwind_Exception;
4852
memset(&exc->exception_class, 0, sizeof(exc->exception_class));
49-
exc->exception_cleanup = 0;
53+
exc->exception_cleanup = cleanup;
5054
_Unwind_ForcedUnwind(exc, Stop<_Unwind_Stop_Fn>::stop, 0);
5155
abort();
5256
}

libcxxabi/test/forced_unwind3.pass.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ struct Stop<R (*)(Args...)> {
6060
}
6161
};
6262

63+
static void cleanup(_Unwind_Reason_Code, struct _Unwind_Exception* exc) {
64+
delete exc;
65+
}
66+
6367
static void forced_unwind() {
6468
_Unwind_Exception* exc = new _Unwind_Exception;
6569
memset(&exc->exception_class, 0, sizeof(exc->exception_class));
66-
exc->exception_cleanup = 0;
70+
exc->exception_cleanup = cleanup;
6771
_Unwind_ForcedUnwind(exc, Stop<_Unwind_Stop_Fn>::stop, 0);
6872
abort();
6973
}

0 commit comments

Comments
 (0)