This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow sv = &PL_sv_undef; sv_set_undef(sv) to work
authorDavid Mitchell <davem@iabyn.com>
Wed, 28 Dec 2016 14:05:43 +0000 (14:05 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 28 Dec 2016 14:10:29 +0000 (14:10 +0000)
commit49b3432a7438e964c8fc187b40c147293b929233
tree8d0b7ca06daf130e5aa9ae4d4adb3aeb9442253d
parent33f1827ffcb11ab760b1c6b1f0fc240a00058c4b
Allow sv = &PL_sv_undef; sv_set_undef(sv) to work

RT #130385

Technically

    sv = &PL_sv_undef;
    ....
    sv_set_undef(sv)

is modifying a read-only variable and so should croak, but some XS code
relies on the behaviour previous to the introduction of sv_set_undef(),
where:

    sv = &PL_sv_undef;
    ....
    sv_setsv(sv, &PL_undef)

silently succeeds (sv_setsv() returns immediately if src and dst
addresses are the same).
sv.c