1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-02-08 01:01:18 +00:00

Use ...FromStackOffset functions where appropriate

Rather than adding/or-ing the STK_OFFSET constant into a stack offset
to convert it to a pointer in general Lisp memory and then converting
from that to a native address... use the functions specifically
present to do those conversions with embedded checks on stack offset
validity.
This commit is contained in:
Nick Briggs
2024-03-07 10:45:38 -08:00
parent 939c23c03b
commit 68baf6fb30
9 changed files with 21 additions and 21 deletions

View File

@@ -26,7 +26,7 @@
#include "gcarraydefs.h" // for get_package_atom
#include "gcdata.h" // for FRPLPTR
#include "lispemul.h" // for LispPTR, state, CurrentStackPTR, NIL_PTR, NIL
#include "lispmap.h" // for S_POSITIVE, STK_OFFSET
#include "lispmap.h" // for S_POSITIVE
#include "loopsopsdefs.h" // for lcfuncall, LCFetchMethod, LCFetchMethodOrHelp
#include "lspglob.h"
#include "lsptypes.h" // for GetDTD, GetTypeNumber, dtd, Listp, GETWORD
@@ -358,7 +358,7 @@ LispPTR lcfuncall(unsigned int atom_index, int argnum, int bytenum)
CURRENTFX->nextblock = (LAddrFromNative(CurrentStackPTR) & 0x0ffff) - (argnum << 1) + 4 /* +3 */;
/* Setup IVar */
IVar = NativeAligned2FromLAddr((((LispPTR)(CURRENTFX->nextblock)) | STK_OFFSET));
IVar = NativeAligned2FromStackOffset(CURRENTFX->nextblock);
/* Set PC to the Next Instruction and save into FX */
CURRENTFX->pc = ((UNSIGNED)PC - (UNSIGNED)FuncObj) + bytenum;