diff --git a/inc/inlineC.h b/inc/inlineC.h index 5950829..9d09aaf 100755 --- a/inc/inlineC.h +++ b/inc/inlineC.h @@ -852,8 +852,7 @@ nextop2; \ #define UNWIND(n, m) \ { \ - if ((INT)(CSTKPTRL = (LispPTR *) \ - N_OP_unwind(CSTKPTR, TOPOFSTACK, n, m)) < 0) \ + if ((CSTKPTRL = N_OP_unwind(CSTKPTR, TOPOFSTACK, n, m)) == (LispPTR *)-1) \ goto unwind_err; \ POP; \ nextop3; \ diff --git a/inc/unwinddefs.h b/inc/unwinddefs.h index 07789aa..cf8caaf 100644 --- a/inc/unwinddefs.h +++ b/inc/unwinddefs.h @@ -1,4 +1,4 @@ #ifndef UNWINDDEFS_H #define UNWINDDEFS_H 1 -UNSIGNED N_OP_unwind(register LispPTR *cstkptr, register LispPTR tos, int n, int keep); +LispPTR *N_OP_unwind(register LispPTR *cstkptr, register LispPTR tos, int n, int keep); #endif diff --git a/src/unwind.c b/src/unwind.c index f9d02af..b32b189 100644 --- a/src/unwind.c +++ b/src/unwind.c @@ -28,7 +28,7 @@ #include "unwinddefs.h" -UNSIGNED N_OP_unwind(register LispPTR *cstkptr, register LispPTR tos, int n, int keep) { +LispPTR *N_OP_unwind(register LispPTR *cstkptr, register LispPTR tos, int n, int keep) { register int num; /* number of UNBOUND slot */ register LispPTR *endptr; /* unwind limit */ register LispPTR *lastpvar; /* points PVar slot that is unbounded. */ @@ -64,7 +64,10 @@ UNSIGNED N_OP_unwind(register LispPTR *cstkptr, register LispPTR tos, int n, int if (endptr > cstkptr) { CurrentStackPTR = (DLword *)cstkptr; - ERROR_EXIT(tos); + /* this would be ERROR_EXIT(tos); but for having to return a pointer */ + TopOfStack = tos; + Error_Exit = 1; + return (LispPTR *)(-1); } *cstkptr++ = tos; @@ -85,7 +88,7 @@ UNSIGNED N_OP_unwind(register LispPTR *cstkptr, register LispPTR tos, int n, int /* endptr = cstkptr */ if (keep) { *(cstkptr++) = tos; } - return ((UNSIGNED)cstkptr); + return (cstkptr); } /* N_OP_unwind */