On Fri Nov 02 18:00:19 2012, SMUELLER wrote:
Show quoted text> On Fri Nov 02 11:08:55 2012, RIBASUSHI wrote:
> > In perl it is legal to declare hashes with null-containing keys, e.g.
> > { "foo\0bar" => "bar", "foo\0baz" => "baz" }
>
> Perfectly valid bug, very bizarre use case...
>
> It's hard to fix because perls until recently did not have a way of
> specifying string (namespace/function-name) length when creating a new
> XSUB via newXS.
>
> On older Perls, one could emulate that somewhat, but my attempts of
> using newXS(NULL, ...) to create an anon function and then installing it
> manually have generally invalidated the generated function name in error
> messages (__ANON__), so I don't have a good solution for any released
> Perls.
>
> Would it be good enough to simply forbid the use of any method names
> with NULLs?
I think you misread my bugreport - I was specifically talking about the
*hash keys*. Method names containing special chars (or unicode for that
matter) can go stuff themselves.
Show quoted text>
> Apart from that, a similar bug pertains to the chosen hash key names (we
> also suffer from the T_PV XS typemap's strlen() weakness there).
Right - look carefully at my import() call:
use Class::XSAccessor accessors => { bar => "foo\0bar", baz => "foo\0baz" };
The method names are normal. The hash-key (field) is the bizarre one.