diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -239,6 +239,7 @@ static const char *const nodetypes[] = { "Node_var_array", "Node_var_new", "Node_param_list", + "Node_alias", "Node_func", "Node_ext_func", "Node_builtin_func", @@ -291,6 +292,7 @@ static struct optypetab { { "Op_not", "! " }, { "Op_assign", " = " }, { "Op_store_var", " = " }, + { "Op_clear_var", " = <undefined>" }, { "Op_store_sub", " = " }, { "Op_store_field", " = " }, { "Op_assign_times", " *= " }, @@ -1262,17 +1264,18 @@ static INSTRUCTION * setup_frame(INSTRUCTION *pc) { NODE *r = NULL; - NODE *m, *f, *fp; + NODE *m, *f, **fp; NODE **sp = NULL; - int pcount, arg_count, i, j; + int pcount, lcount, arg_count, i, j; f = pc->func_body; pcount = f->param_cnt; + lcount = f->frame_cnt; fp = f->fparms; arg_count = (pc + 1)->expr_count; - if (pcount > 0) { - ezalloc(sp, NODE **, pcount * sizeof(NODE *), "setup_frame"); + if (lcount > 0) { + ezalloc(sp, NODE **, lcount * sizeof(NODE *), "setup_frame"); } /* check for extra args */ @@ -1287,7 +1290,7 @@ setup_frame(INSTRUCTION *pc) } while (--arg_count > pcount); } - for (i = 0, j = arg_count - 1; i < pcount; i++, j--) { + for (i = 0, j = arg_count - 1; i < lcount; i++, j--) { getnode(r); memset(r, 0, sizeof(NODE)); sp[i] = r; @@ -1295,7 +1298,7 @@ setup_frame(INSTRUCTION *pc) if (i >= arg_count) { /* local variable */ r->type = Node_var_new; - r->vname = fp[i].param; + r->vname = fp[i]->param; continue; } @@ -1347,7 +1350,7 @@ setup_frame(INSTRUCTION *pc) default: cant_happen("unexpected parameter type %s", nodetype2str(m->type)); } - r->vname = fp[i].param; + r->vname = fp[i]->param; } stack_adj(-arg_count); /* adjust stack pointer */ @@ -1390,7 +1393,7 @@ restore_frame(NODE *fp) INSTRUCTION *ri; func = frame_ptr->func_node; - n = func->param_cnt; + n = func->frame_cnt; sp = frame_ptr->stack; for (; n > 0; n--) { |