Hi,
When a hash is tied keysv is passed to STORE, and calling
the
overload handler may trigger side effects whose value is
never used
anyway.
Attached is a patch to fix this, including an additional
case for
t/op/tie.t.
There is one bit of code that seems strange to me now but I
haven't
removed since I don't really know what I'm doing:
/* XXX remove at some point? */
if (flags & HVhek_FREEKEY)
Safefree(key);
(there are two other instances).
This is called twice from within the blocks that handle tie
magic. Previously
this value was the overloaded string, not the key pointer as
it was passed into
the function.
In short, somebody please make sure that it really has to
stay there, or fix
the patch otherwise.
Thanks,
Yuval
--
Yuval Kogman <nothingmuch woobling.org>
http://nothingmuch.wo
obling.org 0xEBD27418
|