Preserve undef identity in const ops
authorFather Chrysostomos <sprout@cpan.org>
Fri, 13 Sep 2013 01:26:30 +0000 (18:26 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 13 Sep 2013 07:49:38 +0000 (00:49 -0700)
commitd054cdb0a9fbeeddfa67b2ef90ca115307f28fb0
treec72f02bf2517e897dbf6d673f8f6f682ea35a13e
parent5a30840846a8088d75ff1b46453e793b63a6f93f
Preserve undef identity in const ops

This fixes the one remaining issue in ticket #105906.

Under ithreads, the constants are transferred to the pad at compile
time.  Since the pads are AVs, and since AVs used &PL_sv_undef to rep-
resent unused slots, &PL_sv_undef could not be stored in the pad, and
so was copied.

That meant the same constant would produce a different scalar at each
call site:

$  ./perl -Ilib -le 'BEGIN { $::{z} = \undef }  for(z,z) { print \$_ }'
SCALAR(0x7fecb38062e0)
SCALAR(0x7fecb3806100)

Commit ce0d59f changed the way AVs work, so now we *can* store
&PL_sv_undef in an AV meaningfully, and there is no longer any need
for this copying hack.
op.c
t/op/undef.t