diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 17:44:08 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 17:44:08 -0400 |
| commit | c941b9a3325228eba404455afea7ccea0da45095 (patch) | |
| tree | d4ca88c6848ac2e6ceee635bb87add87ba6d2322 /src/environment.c | |
| parent | 1cec086a6034ad546977cae7aeaf4bb876d21970 (diff) | |
Fix tests
Diffstat (limited to 'src/environment.c')
| -rw-r--r-- | src/environment.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/environment.c b/src/environment.c index 603a04d9..ccbe4a8f 100644 --- a/src/environment.c +++ b/src/environment.c @@ -573,10 +573,10 @@ env_t *fresh_scope(env_t *env) { } env_t *with_enum_scope(env_t *env, type_t *t) { - while (t->tag == OptionalType) + while (t && t->tag == OptionalType) t = Match(t, OptionalType)->type; - if (t->tag != EnumType) return env; + if (t == NULL || t->tag != EnumType) return env; env = fresh_scope(env); env_t *ns_env = Match(t, EnumType)->env; for (tag_t *tag = Match(t, EnumType)->tags; tag; tag = tag->next) { |
