Fix stack overflow bug, copying fix from PCRE1.

3 files changed