1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-03 01:57:54 +00:00

Although an unlikely case, LispNumToCInt() should handle negative SmallP numbers correctly

This commit is contained in:
Nick Briggs
2023-11-17 13:11:11 -08:00
parent 28d7d5ec00
commit 56e7591ada

View File

@@ -194,8 +194,9 @@ do { \
#endif /* min */
#define LispNumToCInt(Lisp) \
( (((Lisp) & SEGMASK) == S_POSITIVE) ? \
((Lisp) & 0xFFFF) : (*((int *)(NativeAligned4FromLAddr(Lisp)))) )
( (((Lisp) & SEGMASK) == S_POSITIVE) ? ((Lisp) & 0xFFFF) : \
(((Lisp) & SEGMASK) == S_NEGATIVE) ? ((Lisp) | 0xFFFF0000) : \
(*((int *)(NativeAligned4FromLAddr(Lisp)))) )
#define UPLOWDIFF 0x20