List Info

Thread: don't trigger stringification of key when hash is tied




don't trigger stringification of key when hash is tied
user name
2007-09-16 13:40:51
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 <nothingmuchwoobling.org>
http://nothingmuch.wo
obling.org  0xEBD27418


  
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )