File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,10 @@ Object* const cUndef = reinterpret_cast<Object*>(0x22L);
93
93
94
94
// Indicates the mask to use to check if a value is ruby false.
95
95
// This mask matches both false and nil ONLY.
96
- #define FALSE_MASK 0xf
96
+ #define FALSE_MASK 0xf
97
+
98
+ // The bits that identify any nil value.
99
+ #define NIL_MASK 0x1f
97
100
98
101
#define CBOOL (v ) (((uintptr_t )(v) & FALSE_MASK) != (uintptr_t )cFalse)
99
102
#define RBOOL (v ) ((v) ? cTrue : cFalse)
@@ -586,7 +589,7 @@ Object* const cUndef = reinterpret_cast<Object*>(0x22L);
586
589
void wait (STATE);
587
590
588
591
bool nil_p () const {
589
- return this == reinterpret_cast <ObjectHeader* >(cNil);
592
+ return ( reinterpret_cast < intptr_t >( this ) & NIL_MASK) == reinterpret_cast <intptr_t >(cNil);
590
593
}
591
594
592
595
bool true_p () const {
You can’t perform that action at this time.
0 commit comments