mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Empty pattern string can generate TR_UNINITIALIZED pattern; fix #4156
This commit is contained in:
@@ -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];
|
||||
}
|
||||
else {
|
||||
mrb_assert(FALSE); // should not reach
|
||||
mrb_assert(pat->type == TR_UNINITIALIZED);
|
||||
}
|
||||
n_sum += pat->n;
|
||||
pat = pat->next;
|
||||
|
||||
Reference in New Issue
Block a user