fix: some analysis stage problems
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user