Skip to content

Commit

Permalink
Fixed bug with static_branches
Browse files Browse the repository at this point in the history
  • Loading branch information
bras5523 committed Aug 6, 2024
1 parent 2162096 commit d787ba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
{.name="parameters", .calltype=call, .returns=true, .rettype=list},
{.name="input", .calltype=call, .returns=true, .rettype=string},
{.name="open", .calltype=call, .argc=2, .args={string, string}, .returns=true, .rettype=io},
{.name="with", .calltype=call, .argc=3, .args={string, string, block}, .stack=true},
{.name="read-file", .calltype=call, .argc=1, .args={io}, .returns=true, .rettype=string},
{.name="close", .calltype=call, .argc=1, .args={io}},
{.name="path", .calltype=call, .returns=true, .rettype=string},
Expand Down
12 changes: 6 additions & 6 deletions src/cognac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2853,15 +2853,15 @@ void static_branches(module_t* m)
pop_register_front(regs);
clear_registers(regs); // Assume all functions are stack at this point.
if (f->returns)
push_register_front(make_register(f->rettype, a), regs);
push_register_front(make_register(f->rettype, a), regs);
break;
}
case bind:
{
reg_t* r = pop_register_front(regs);
if (r && r->source)
{
a->op->word->val->source = r->source;
//a->op->word->val->source = r->source;
}
break;
}
Expand Down Expand Up @@ -3155,18 +3155,18 @@ int main(int argc, char** argv)
flatten_ast,
merge_symbols,
assign_sequence_numbers,
//inline_functions,
//static_branches,
inline_functions,
static_branches,
static_calls,
determine_arguments,
compute_stack,
add_arguments,
add_generics,
//balance_branches,
balance_branches, // IDK if this is needed
compute_stack,
add_registers,
shorten_references,
//inline_values,
//inline_values, // I can't remember if this is broken or not
compute_variables,
resolve_early_use,
determine_unique_calls,
Expand Down

0 comments on commit d787ba6

Please sign in to comment.