aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-11 12:56:16 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-11 12:56:16 -0400
commit02930b84f821b22cfd629b64169dc0b5a4b8fe74 (patch)
treec3b68dd707ff88baae6304366fec75bdd5e19cc0 /compile.c
parent908673c9d95a57e794dc1ee5708ffb511958abb9 (diff)
Optionals for threads
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 6688a5ed..85321000 100644
--- a/compile.c
+++ b/compile.c
@@ -27,7 +27,9 @@ static CORD promote_to_optional(type_t *t, CORD code);
CORD promote_to_optional(type_t *t, CORD code)
{
- if (t->tag == IntType) {
+ if (t == THREAD_TYPE) {
+ return code;
+ } else if (t->tag == IntType) {
switch (Match(t, IntType)->bits) {
case TYPE_IBITS8: return CORD_all("((OptionalInt8_t){.i=", code, "})");
case TYPE_IBITS16: return CORD_all("((OptionalInt16_t){.i=", code, "})");