diff --git a/interpret.h b/interpret.h index 3215833..0293436 100644 --- a/interpret.h +++ b/interpret.h @@ -1065,6 +1065,8 @@ match_re: if (op != Op_match_rec) { decr_sp(); DEREF(t1); + if (m->type == Node_dynregex) + DEREF(m->re_exp); } r = node_Boolean[di]; UPREF(r); @@ -1077,7 +1079,6 @@ match_re: m = pc->memory; t1 = TOP_STRING(); if (m->type == Node_dynregex) { - unref(m->re_exp); m->re_exp = t1; decr_sp(); t1 = TOP_STRING();