This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix tainting and overload
authorDavid Mitchell <davem@iabyn.com>
Tue, 22 Jun 2010 16:03:12 +0000 (17:03 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sat, 3 Jul 2010 15:25:58 +0000 (16:25 +0100)
commita02ec77af3235fc3d744725d93fbef7d9126695a
tree4db33cf47ccd836490de9f68821eb15f31483096
parent3340ac375f37f424a40787ccf00c582048903d8d
fix tainting and overload

Sometimes when an overload method returned a tainted value, that
taintedness got lost. This fixes #75716: overload removes tainting.

It also considerably expands the tied series of tests in overload.t.
It now taints the return value, and checks for correct taintedness.
It also tests against two overload packages: the new one only has fallback
methods, which affects the return path for the tainted value.

It now also compares the expected (non-tied, non-overload) expression
value against a overloaded version of that expression in addition to
versions where a tied var returned an overloaded object; e.g. in these
expressions:
    1: 1 + $plain_value
    2: 1 + $overloaded_var
    3: 1 + $tied_scalar_that_returns_overloaded_value
    4: 1 + $tied_array_whose element_0_holds_an_overloaded_value[0]
then the value of expression 1 is compared against each of 2,3,4, whereas
before it was only compared against 3,4.
lib/overload.t
sv.c