From 0093a03574bbba793d955f988790511cd83690af Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sat, 16 Sep 2017 14:38:27 -0700 Subject: [PATCH] microcode: Do not save history_register locally. The required change to C_call_scheme is described but not implemented. C_call_scheme has other problems(?). Preferring a rotated history to a broken history (broken by a GC during a callback) for now. --- src/microcode/interp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/microcode/interp.h b/src/microcode/interp.h index 2253554f1..163a4ec49 100644 --- a/src/microcode/interp.h +++ b/src/microcode/interp.h @@ -63,6 +63,7 @@ USA. #define CHECK_RETURN_CODE(code, offset) \ ((CONT_RET (offset)) == (MAKE_RETURN_CODE (code))) +#if 0 /* Saving history is required for C_call_scheme to work correctly because the recursive call to Interpret() can rotate the history. */ @@ -72,6 +73,15 @@ USA. PRIMITIVE_APPLY (primitive); \ history_register = APFI_saved_history; \ } while (0) + +#else +/* C_call_scheme must save/restore history_register on/from the stack + so that it will be relocated if the call to Interpret() causes a + garbage collection. */ + +#define APPLY_PRIMITIVE_FROM_INTERPRETER PRIMITIVE_APPLY + +#endif /* Stack manipulation */ -- 2.25.1