This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use SvUPGRADE, not sv_upgrade, in sv_sethek
authorFather Chrysostomos <sprout@cpan.org>
Fri, 4 Nov 2011 07:17:52 +0000 (00:17 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 4 Nov 2011 07:17:52 +0000 (00:17 -0700)
commit5a0c33f0faa0788274560b4dfe1e4c63376f3ae9
tree56d30781af4cfbe650f310b33a37b60fb0f1464e
parent958ed56b56ac968f085804fdab7d5684be218657
Use SvUPGRADE, not sv_upgrade, in sv_sethek

This was causing some interesting HTML::Element failures, which were
only triggered by HTML::DOM’s test suite.

ref’s TARG can become tainted if another op in the same statement
turns on tainting for the rest of the statement, so it becomes a PVMG.
The next call to the same ref will try to sv_upgrade it to a PV (which
is lower).  Only the macro version, SvUPGRADE, checks whether the
upgrade is needed.

ref only calls sv_sethek when it has a blessed object for its argu-
ment, hence the strange-looking test.
sv.c
t/op/taint.t