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>
Tue, 5 Jul 2011 11:14:10 +0000 (12:14 +0100)
commitbb789b09de07edfb74477eb1603949c96d60927d
treea57a7c21d25d4723def7c37addc8d2bbf7ffa4c2
parent832c2e57b07ad49b00fbc8f3ce4bda3e9f205f95
fix segv in regcomp.c:S_join_exact()

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