aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-19 15:14:00 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-19 15:14:00 -0400
commitccdf9d319f796cbb30b245510931143c014636f5 (patch)
tree4d961af2afd17d65a9be7045ca5b254a3e0360aa
parent3aad698b2b198e3308a8d21c07465b2db6bbde2f (diff)
Bugfix
-rw-r--r--types.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/types.c b/types.c
index a1935616..5fb591ca 100644
--- a/types.c
+++ b/types.c
@@ -13,7 +13,10 @@ CORD type_to_cord(type_t *t) {
switch (t->tag) {
case UnknownType: return "???";
case AbortType: return "Abort";
- case ReturnType: return CORD_all("Return(", type_to_cord(Match(t, ReturnType)->ret), ")");
+ case ReturnType: {
+ type_t *ret = Match(t, ReturnType)->ret;
+ return CORD_all("Return(", ret ? type_to_cord(ret) : "Void", ")");
+ }
case VoidType: return "Void";
case MemoryType: return "Memory";
case BoolType: return "Bool";