Refactor the integer overflow testing so as to avoid imposing an artificial limit on the size of subpatterns.
Changed paths: