This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t call get-magic on a referenced array in chdir, etc.
authorFather Chrysostomos <sprout@cpan.org>
Sat, 10 Sep 2011 17:01:00 +0000 (10:01 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 10 Sep 2011 20:46:59 +0000 (13:46 -0700)
commitf8afbfa6f0265771da81b080f6c9fa9d7c17139b
tree19ecdb8a903cfb3d6c62680c28e85cf4b2c4fad2
parente5f60eac5cc3e1455d43f445ad19dc58277d8466
Don’t call get-magic on a referenced array in chdir, etc.

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.
pp.h