Commit
557fbd17eb added the MAYBE_DEREF_GV macro, which 2ea1cce
applied to chdir, chmod and chown.
That macro calls get-magic on its arguments checks to see if it might
be a gv or ref and, if it’s a ref, calls get-magic on the referent,
to see whether it will turn into a gv. That means we’ll end up with
chdir($array_obj) calling get-magic on the array. While probably
harmless, calling get-magic is superfluous and probably incorrect. I
don’t know that there is a reasonable way to test this.
SvGETMAGIC(sv), \
isGV_with_GP(sv) \
? (GV *)sv \
- : SvROK(sv) && (SvGETMAGIC(SvRV(sv)), isGV_with_GP(SvRV(sv))) \
+ : SvROK(sv) && SvTYPE(SvRV(sv)) <= SVt_PVLV && \
+ (SvGETMAGIC(SvRV(sv)), isGV_with_GP(SvRV(sv))) \
? (GV *)SvRV(sv) \
: NULL \
)