Empty pattern string can generate `TR_UNINITIALIZED` pattern; fix #4156

parent 7ad53273
...@@ -368,7 +368,7 @@ tr_find_character(const struct tr_pattern *pat, const char *pat_str, int ch) ...@@ -368,7 +368,7 @@ tr_find_character(const struct tr_pattern *pat, const char *pat_str, int ch)
ret = n_sum + ch - pat->val.ch[0]; ret = n_sum + ch - pat->val.ch[0];
} }
else { else {
mrb_assert(FALSE); // should not reach mrb_assert(pat->type == TR_UNINITIALIZED);
} }
n_sum += pat->n; n_sum += pat->n;
pat = pat->next; pat = pat->next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment