[perl #121362] overload optimisation added a SEGV
authorDavid Mitchell <davem@iabyn.com>
Tue, 4 Mar 2014 19:03:02 +0000 (19:03 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 4 Mar 2014 19:09:30 +0000 (19:09 +0000)
commit45479970582e5de29004c3c1ae1e0a4274843567
tree34e84abac49ccba0b756c2919dd06742ef3b187c
parent04775fa2c5928f43179fdef4a100c540f11d2093
[perl #121362] overload optimisation added a SEGV

My recent commit 3d147ac29d12abdb to "speed up (non)overloaded derefs"
introduced a potential SEGV. In Perl_Gv_AMupdate(), the 'aux' variable is
set to HvAUX(hv). My patch used the value of the variable later on in the
function, but it turns out that by then, S_hsplit() may have been called,
and thus HvARRAY (and HvAUX()) may have been reallocated.

Issue first spotted by Andreas' awesome BBC service, and diagnosed by
Nicholas Clark.
gv.c
lib/overload.t