make core safe against HvAUX() realloc
authorDavid Mitchell <davem@iabyn.com>
Fri, 7 Mar 2014 17:45:27 +0000 (17:45 +0000)
committerDavid Mitchell <davem@iabyn.com>
Fri, 7 Mar 2014 17:45:27 +0000 (17:45 +0000)
commit339441efdfcbaef5dbf131db2224abb35f5ae920
treec5f5b4226dbf847ba56319b61a0f9dc67573622f
parent70bc21b7ad97027997a11a7f2426306cb48874e3
make core safe against HvAUX() realloc

Since the HvAUX structure is just tacked onto the end of the HvARRAY()
struct, code like this can do bad things:

    aux = HvAUX();
    ... something that might split hv ...
    aux->foo = ...; /* SEGV! */

So I've visually audited core for places where HbAUX() is saved and then
re-used, and re-initialised the var if it looks like HvARRAY() could
have changed in the meantime.

I've been very conservative about what might be unsafe. For example,
destructors or __WARN__ handlers could call perl code that modifies the
hash.
gv.c
hv.c