Skip to content

Commit 79b97a7

Browse files
Fix fltnz double predicate
1 parent 021a5b0 commit 79b97a7

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

runtime/Clib/inline_alloc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* ------------------------------------------------------------- */
44
/* Author : Manuel Serrano */
55
/* Creation : Thu Oct 26 15:43:27 2017 */
6-
/* Last change : Tue Jul 1 19:11:41 2025 (serrano) */
6+
/* Last change : Wed Jul 2 17:10:58 2025 (serrano) */
77
/* Copyright : 2017-25 Manuel Serrano */
88
/* ------------------------------------------------------------- */
99
/* Single-threaded Boehm allocations */
@@ -226,8 +226,8 @@ static obj_t alloc_make_real(double d) {
226226

227227
GC_API obj_t make_real(double d) {
228228
# if (!defined(TAG_REALZ))
229-
if ((((union { double d; int64_t l; })(d)).l << 1) == 0) {
230-
if (((union { double d; int64_t l; })(d)).l == 0) {
229+
if ((((union { double d; uint64_t l; })(d)).l << 1) == 0) {
230+
if (((union { double d; uint64_t l; })(d)).l == 0) {
231231
return bgl_zero;
232232
} else {
233233
return bgl_negative_zero;

runtime/Include/bigloo_real_flt.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* ------------------------------------------------------------- */
44
/* Author : Manuel Serrano */
55
/* Creation : Sun Mar 6 07:07:32 2016 */
6-
/* Last change : Wed Jul 2 06:06:42 2025 (serrano) */
6+
/* Last change : Wed Jul 2 18:07:52 2025 (serrano) */
77
/* Copyright : 2016-25 Manuel Serrano */
88
/* ------------------------------------------------------------- */
99
/* Bigloo FLOATING POINT TAGGING reals */
@@ -203,7 +203,11 @@ INLINE bool BGL_TAGGED_REALP(obj_t _o) {
203203
# define FLONUMP(o) (((int32_t)((uint32_t)BGL_FLONUMP_TAG_MASK_TABLE * 0x1010101) << (long)(o)) < 0)
204204
# define BGL_FAST_REALVAL(o) ((int32_t)((uint32_t)BGL_FAST_FLONUMP_TAG_MASK_TABLE * 0x1010101) << (long)(o))
205205
# define BGL_FAST_REALP(o) (BGL_FAST_REALVAL(o) < 0)
206-
# define BGL_FAST_REALSP(o, p) ((BGL_FAST_REALVAL(o) | BGL_FAST_REALVAL(p)) < 0)
206+
# if (defined(TAG_REALZ))
207+
# define BGL_FAST_REALSP(o, p) ((BGL_FAST_REALVAL(o) | BGL_FAST_REALVAL(p)) < 0)
208+
# else
209+
# define BGL_FAST_REALSP(o, p) (BGL_FAST_REALP(o) && BGL_FAST_REALP(p))
210+
# endif
207211
#endif
208212
// ---
209213

0 commit comments

Comments
 (0)