fix: some analysis stage problems

This commit is contained in:
samsonium
2026-10-27 14:12:09 +03:00
parent 411d291a2c
commit c61322718d
10 changed files with 69 additions and 18 deletions
+8 -2
View File
@@ -20,9 +20,15 @@ fzl_an_res_t analyze_conditional(fzl_analyzer_t *analyzer, fzl_node_t *cond)
fzl_an_res_t cond_res = analyze_common(analyzer, cond->cond.condition);
fzl_an_res_t true_res = analyze_common(analyzer, cond->cond.true_block);
fzl_an_res_t else_res = analyze_common(analyzer, cond->cond.else_block);
if (cond_res.error || true_res.error || else_res.error)
if (cond->cond.else_block)
{
fzl_an_res_t else_res = analyze_common(analyzer, cond->cond.else_block);
if (else_res.error)
return (fzl_an_res_t){.error = true};
}
if (cond_res.error || true_res.error)
return (fzl_an_res_t){.error = true};
if (cond_res.type != FZL_TYPE_BOOL)