aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--miscutils/bc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 7fcf00aa9..c59d5a2b5 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -3624,13 +3624,11 @@ static size_t bc_program_addFunc(char *name)
3624 idx = entry_ptr->idx; 3624 idx = entry_ptr->idx;
3625 3625
3626 if (!inserted) { 3626 if (!inserted) {
3627 // There is already a function with this name.
3628 // It'll be redefined now, clear old definition.
3627 BcFunc *func = bc_program_func(entry_ptr->idx); 3629 BcFunc *func = bc_program_func(entry_ptr->idx);
3628 3630 bc_func_free(func);
3629 // We need to reset these, so the function can be repopulated. 3631 bc_func_init(func);
3630 func->nparams = 0;
3631 bc_vec_pop_all(&func->autos);
3632 bc_vec_pop_all(&func->code);
3633 bc_vec_pop_all(&func->labels);
3634 } else { 3632 } else {
3635 bc_func_init(&f); 3633 bc_func_init(&f);
3636 bc_vec_push(&G.prog.fns, &f); 3634 bc_vec_push(&G.prog.fns, &f);