regex and overload: unifiy 1 and N arg branches
authorDavid Mitchell <davem@iabyn.com>
Mon, 25 Mar 2013 17:06:47 +0000 (17:06 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 12 Apr 2013 10:29:54 +0000 (11:29 +0100)
commit16cc92aeb437b42b3f141f69d8d60dae5309ec0f
tree3431a566caad5c9273f2473c92fe6e3a5940b14f
parent5dd442fcfdfbfbdd8bc0fdb52cd98474826ec4fe
regex and overload: unifiy 1 and N arg branches

When compiling a regex, something like /a$b/ that parses two two args,
was treated in a different code path than /$a/ say, which is only one arg.

In particular the 1-arg code path, where it handled "" overloading, didn't
check for a loop (where the ""-sub returns the overloaded object itself) -
the N-arg branch did handle that. By unififying the branches, we get that
fix for free, and ensure that any future fixes don't have to be applied to
two separate branches.

Re-indented has been left to the commit that follows this.
regcomp.c
t/re/overload.t