aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/profile.c b/profile.c
index e4380280..e6a528d3 100644
--- a/profile.c
+++ b/profile.c
@@ -246,7 +246,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
if (rule != Rule) {
/* Allow for pre-non-rule-block comment */
- if (pc->nexti != (pc +1)->firsti
+ if (pc->nexti != (pc+1)->firsti
&& pc->nexti->opcode == Op_comment
&& pc->nexti->memory->comment_type == BLOCK_COMMENT)
print_comment(pc->nexti, -1);
@@ -945,13 +945,19 @@ cleanup:
if (pc->opcode == Op_K_case) {
t1 = pp_pop();
fprintf(prof_fp, "%s %s:", op2str(pc->opcode), t1->pp_str);
- pc = end_line(pc);
pp_free(t1);
- } else {
+ } else
fprintf(prof_fp, "%s:", op2str(pc->opcode));
- pc = end_line(pc);
- }
+
indent_in();
+ if (pc->comment != NULL) {
+ if (pc->comment->memory->comment_type == EOL_COMMENT)
+ fprintf(prof_fp, "\t%s", pc->comment->memory->stptr);
+ else {
+ fprintf(prof_fp, "\n");
+ print_comment(pc->comment, indent_level);
+ }
+ }
pprint(pc->stmt_start->nexti, pc->stmt_end->nexti, NO_PPRINT_FLAGS);
indent_out();
break;