regcomp utf8 len cache panic
authorDavid Mitchell <davem@iabyn.com>
Tue, 10 Dec 2013 17:17:06 +0000 (17:17 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 7 Feb 2014 22:39:35 +0000 (22:39 +0000)
commitd54614d3b23d940f0dda155d782743dc46ebfc99
tree34872ae55ca0593ccbc9e23216e68e1f83b72d3e
parent769e4861d3176ce691c41777140ccac986ca9a37
regcomp utf8 len cache panic

Compiling this regex:

    /\x{100}[xy]\x{100}{2}/

caused this:

    panic: sv_len_utf8 cache 1 real 2

This was due to the code in S_study_chunk() mixing up char and byte
lengths when updating the utf8 length cache on a utf8 string that
had been extended by repeatedly duplicating the last n chars.

(The second test is for an issue introduced during an initial attempt to
fix this).
regcomp.c
t/re/re_tests