From 30bfeb3a4328cad13a601a7f0cf47db2f0ad6096 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Tue, 11 Aug 2020 14:09:19 -0700 Subject: [PATCH] WARN() macro is used in functions with and without return values so must not return in the macro. Fix llstk.c uses of WARN() to return when necessary. modified: inc/lispemul.h modified: src/llstk.c --- inc/lispemul.h | 2 +- src/llstk.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/inc/lispemul.h b/inc/lispemul.h index fccc24e..4f7ce90 100755 --- a/inc/lispemul.h +++ b/inc/lispemul.h @@ -498,7 +498,7 @@ extern int error(char *); #define TIMER_EXIT(tos) {TopOfStack=tos; Error_Exit = 1; return(-2);} -#define WARN(message,operation) {warn(message);operation;return;} +#define WARN(message,operation) {warn(message);operation;} #define NO_WOP {} #define NIL 0 /* added 29-jan */ diff --git a/src/llstk.c b/src/llstk.c index e8d6fb5..da76bbb 100644 --- a/src/llstk.c +++ b/src/llstk.c @@ -112,6 +112,7 @@ tryfsb: #endif /* BIGVM */ if ((n <= StkOffset_from_68K(oldfx68k)) && (n >= oldfx68k->nextblock)) { WARN("moveframe:check!!", sff(LADDR_from_68k(oldfx68k))); + return 0; /* ? */ } } #endif @@ -348,10 +349,12 @@ SCAN: if (((Bframe *)scanptr68k)->residual) { if (scanptr68k != orig68k) { WARN("freestackblock:scanptr68k !=org", printf(":0x%x\n", LADDR_from_68k(scanptr68k))); + return 0; /* ? */ } } else { if (((Bframe *)scanptr68k)->ivar != StkOffset_from_68K(orig68k)) { WARN("BF doesn't point TopIVAR", printf(":0x%x\n", LADDR_from_68k(scanptr68k))); + return 0; /* ? */ } } #endif @@ -531,6 +534,14 @@ void blt(register DLword *dest68k, register DLword *source68k, int nw) { for DEBUG */ /**************************************************************/ +#ifdef FSBCHECK + struct big_fsbs { + DLword offset; + DLword size; + } bigFSB[100]; + int bigFSBindex = 0; +#endif + void stack_check(StackWord *start68k) { StackWord *scanptr68k; StackWord *endstack68k; @@ -541,12 +552,6 @@ void stack_check(StackWord *start68k) { DLword freesize; #ifdef FSBCHECK - struct big_fsbs { - DLword offset; - DLword size; - } bigFSB[100]; - int bigFSBindex = 0; - memset((char *)bigFSB, 0, 100 * 2 * 2); #endif