aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorStephen Davies <sdavies@sdc.com.au>2014-09-08 13:46:17 +0930
committerStephen Davies <sdavies@sdc.com.au>2014-09-08 13:46:17 +0930
commita1df6304be3c217877919097d2e4b3b16de6cd02 (patch)
tree163053fd29f5f60f022193b1e55cebc42f83caf0 /profile.c
parent1cc790ecafc378da1dbbda8480a2a41f13c1821e (diff)
downloadegawk-a1df6304be3c217877919097d2e4b3b16de6cd02.tar.gz
egawk-a1df6304be3c217877919097d2e4b3b16de6cd02.tar.bz2
egawk-a1df6304be3c217877919097d2e4b3b16de6cd02.zip
profile.c fixes
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/profile.c b/profile.c
index 8eb31b24..f1ced7e1 100644
--- a/profile.c
+++ b/profile.c
@@ -176,8 +176,6 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
char *str;
NODE *t2;
INSTRUCTION *ip;
- INSTRUCTION *ic;
- INSTRUCTION *i2;
NODE *m;
char *tmp;
int rule;
@@ -198,7 +196,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
if (ip->opcode == Op_comment){
/* print pre-begin/end comments */
print_comment(ip, 0);
- ip = ip->nexti->nexti;
+ ip = ip->nexti;
}
if (do_profile && ! rule_count[rule]++)
fprintf(prof_fp, _("\t# %s block(s)\n\n"), ruletab[rule]);
@@ -206,8 +204,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, bool in_for_header)
} else {
if (do_profile && ! rule_count[rule]++)
fprintf(prof_fp, _("\t# Rule(s)\n\n"));
- ic = ip = pc->nexti;
- i2 = (pc + 1)->firsti;
+ ip = pc->nexti;
lind = ip->exec_count;
/*print pre-block comments */
if(ip->opcode == Op_exec_count && ip->nexti->opcode == Op_comment)ip = ip->nexti;
@@ -1533,7 +1530,8 @@ pp_func(INSTRUCTION *pc, void *data ATTRIBUTE_UNUSED)
print_comment(fp, 0);
fp = fp->nexti;
}
- fprintf(prof_fp, "\t");
+ if (!do_profile)
+ fprintf(prof_fp, "\t");
indent(pc->nexti->exec_count);
fprintf(prof_fp, "%s %s(", op2str(Op_K_function), func->vname);
pcount = func->param_cnt;