Skip to content

Hash::Util::FieldHash: bad use of MAGIC #22961

Open
@leonerd

Description

While reading though some existing uses of PERL_MAGIC_ext to consider conversion into Hooks, I found that what FieldHash.xs does is not good. It uses ext magic with no vtable at all, instead relying on an unlikely value of 0x4944 stored in the mg_private field in the hope of uniquely identifying its own tagging.

Really, this should be done with a unique (static const) vtable, like other modules do.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions