Looking a bit more at the patch:
+ /* miss: check if previous character is part of pattern */
+ if (!(mask & (1 << (s[i-1] & 0x1F))))
From what I understand, this should be s[i-m]. Same here:
+ /* skip: check if previous character is part of pattern */
+ if (!(mask & (1 << (s[i-1] & 0x1F))))