aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/profile.c b/profile.c
index 15b33721..22ec4554 100644
--- a/profile.c
+++ b/profile.c
@@ -59,7 +59,7 @@ static void just_dump(int signum);
/* pretty printing related functions and variables */
static NODE *pp_stack = NULL;
-static NODE *func_params; /* function parameters */
+static NODE **func_params; /* function parameters */
static FILE *prof_fp; /* where to send the profile */
static long indent_level = 0;
@@ -345,6 +345,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
if (pc->initval != NULL)
pp_push(Op_push_i, pp_node(pc->initval), CAN_FREE, pc->comment);
/* fall through */
+ case Op_clear_var:
case Op_store_sub:
case Op_assign_concat:
case Op_push_lhs:
@@ -356,7 +357,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
m = pc->memory;
switch (m->type) {
case Node_param_list:
- pp_push(pc->opcode, func_params[m->param_cnt].param, DONT_FREE, pc->comment);
+ pp_push(pc->opcode, func_params[m->param_cnt]->param, DONT_FREE, pc->comment);
break;
case Node_var:
@@ -383,6 +384,11 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
fprintf(prof_fp, "%s%s%s", t2->pp_str, op2str(pc->opcode), t1->pp_str);
goto cleanup;
+ case Op_clear_var:
+ t2 = pp_pop(); /* l.h.s. */
+ fprintf(prof_fp, "%s%s", t2->pp_str, op2str(pc->opcode));
+ goto cleanup;
+
case Op_store_sub:
t1 = pp_pop(); /* array */
tmp = pp_list(pc->expr_count, op2str(Op_subscript), ", "); /*subscript*/
@@ -973,7 +979,7 @@ cleanup:
array = t1->pp_str;
m = ip1->forloop_cond->array_var;
if (m->type == Node_param_list)
- item = func_params[m->param_cnt].param;
+ item = func_params[m->param_cnt]->param;
else
item = m->vname;
indent(ip1->forloop_body->exec_count);
@@ -2000,7 +2006,7 @@ pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED)
pcount = func->param_cnt;
func_params = func->fparms;
for (j = 0; j < pcount; j++) {
- fprintf(prof_fp, "%s", func_params[j].param);
+ fprintf(prof_fp, "%s", func_params[j]->param);
if (j < pcount - 1)
fprintf(prof_fp, ", ");
}