Skip to content

Commit

Permalink
Although an unlikely case, LispNumToCInt() should handle negative Sma…
Browse files Browse the repository at this point in the history
…llP numbers correctly
  • Loading branch information
nbriggs committed Nov 17, 2023
1 parent 28d7d5e commit 56e7591
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/locfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 56e7591

Please sign in to comment.