This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix segv in regcomp.c:S_join_exact()
authorDavid Mitchell <davem@iabyn.com>
Tue, 5 Jul 2011 10:35:08 +0000 (11:35 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 14 Dec 2012 12:47:48 +0000 (12:47 +0000)
commitebb390a3767eb21f1f35d77eb92061bd48850a9e
tree8abc81bc53a937b0412ab992206591d54bc8728d
parenteae139f3f1da0f91ca0fb543c5f5bc3b2b94cbc9
fix segv in regcomp.c:S_join_exact()

[ cherry-picked from bb789b09de07edfb74477eb1603949c96d60927d
to stop clang's address-sanitizer from complaining. See [perl #115994] ]

This function joins multiple EXACT* nodes into a single node.
At the end, under DEBUGGING, it marks the optimised-out nodes as being
type OPTIMIZED. However, some of the 'nodes' aren't actually nodes;
they're random bits of string at the tail of those nodes. So you
can't peek that the 'node's OP field to decide what type it was.

Instead, just unconditionally overwrite all the slots with fake
OPTIMIZED nodes.
regcomp.c