Adding exception handling for windows.

This commit is contained in:
Brad Nelson
2022-12-31 22:13:19 -08:00
parent 1c500c2233
commit b720575fb2

View File

@ -47,6 +47,8 @@ static cell_t *forth_run(cell_t *init_rp) {
register float *fp, ft;
rp = init_rp; UNPARK;
for (;;) {
__try {
for (;;) {
next:
w = *ip++;
work:
@ -59,4 +61,14 @@ work:
#undef Z
}
}
} __except (1) {
rp = *g_sys->throw_handler;
*g_sys->throw_handler = (cell_t *) *rp--;
sp = (cell_t *) *rp--;
fp = (float *) *rp--;
ip = (cell_t *) *rp--;
--sp;
tos = GetExceptionCode();
}
}
}