aboutsummaryrefslogtreecommitdiff
path: root/builtins/optionals.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-11 14:18:01 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-11 14:18:01 -0400
commit0b5bb32912cfc68c7783548006fca2dc5874eb93 (patch)
treedb5f28d83039ed6f78030f11d347c1c0d7b39664 /builtins/optionals.c
parent273e2f995f1d74e9ef8e9a2e09a3ea2c2b16d839 (diff)
Fix optional bools
Diffstat (limited to 'builtins/optionals.c')
-rw-r--r--builtins/optionals.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtins/optionals.c b/builtins/optionals.c
index 687486db..8a1aaf99 100644
--- a/builtins/optionals.c
+++ b/builtins/optionals.c
@@ -8,7 +8,7 @@
#include "util.h"
public const Array_t NULL_ARRAY = {.length=-1};
-public const Bool_t NULL_BOOL = -1;
+public const OptionalBool_t NULL_BOOL = 2;
public const Int_t NULL_INT = {.small=0};
public const Table_t NULL_TABLE = {.entries.length=-1};
public const Closure_t NULL_CLOSURE = {.fn=NULL};
@@ -19,7 +19,7 @@ static inline bool is_null(const void *obj, const TypeInfo *non_optional_type)
if (non_optional_type == &Int$info)
return ((Int_t*)obj)->small == 0;
else if (non_optional_type == &Bool$info)
- return *((Bool_t*)obj) == NULL_BOOL;
+ return *((OptionalBool_t*)obj) == NULL_BOOL;
else if (non_optional_type == &Num$info)
return isnan(*((Num_t*)obj));
else if (non_optional_type == &Int64$info)