aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/profile.c b/profile.c
index f27f9dda..ebb7b7e6 100644
--- a/profile.c
+++ b/profile.c
@@ -646,11 +646,13 @@ cleanup:
fall through */
case Op_match_rec:
{
- NODE *re = pc->memory->re_exp;
- if (pc->memory->type == Node_regex)
+ if (pc->memory->type == Node_regex) {
+ NODE *re = pc->memory->re_exp;
str = pp_string(re->stptr, re->stlen, '/');
- else
- str = pp_typed_regex(re->stptr, re->stlen, '/');
+ } else {
+ assert((pc->memory->flags & REGEX) != 0);
+ str = pp_typed_regex(pc->memory->stptr, pc->memory->stlen, '/');
+ }
pp_push(pc->opcode, str, CAN_FREE);
}
break;
@@ -673,8 +675,7 @@ cleanup:
str = pp_group3(txt, op2str(pc->opcode), restr);
pp_free(t2);
} else if (m->type == Node_val && (m->flags & REGEX) != 0) {
- NODE *re = m->re_exp;
- restr = pp_typed_regex(re->stptr, re->stlen, '/');
+ restr = pp_typed_regex(m->stptr, m->stlen, '/');
str = pp_group3(txt, op2str(pc->opcode), restr);
efree(restr);
} else {