Skip to content

Commit

Permalink
Fix bug where compiler could Def non-blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
bras5523 committed Aug 5, 2024
1 parent 8d22012 commit b92a5de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cognac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@ bool add_var_types_forwards(module_t* mod)
registers);
break;
case call:
op->op->word->val->type = block;
case static_call:
{
func_t* fn = static_call_to_func(op->op);
Expand All @@ -1769,7 +1770,10 @@ bool add_var_types_forwards(module_t* mod)
if (op->op->word->val->type != strong_any && t != any && op->op->word->val->type != t) // Early use needs to be bound to undefined symbol
{
if (op->op->word->val->type != any)
{
if (op->op->word->calltype == call) type_error(op->op->word->val->type, t, op->op->where);
op->op->word->val->type = strong_any;
}
else
op->op->word->val->type = t;
changed = 1;
Expand Down

0 comments on commit b92a5de

Please sign in to comment.