This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make undef use ck_fun and OA_SCALARREF
authorFather Chrysostomos <sprout@cpan.org>
Sat, 12 May 2012 21:25:44 +0000 (14:25 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 29 May 2012 16:36:25 +0000 (09:36 -0700)
commit89c5c07ef37776cd5a06bc62eaca97cb2091ad3f
treeebaafe25f710be6dd0a904abd828a50278b7375f
parent498a02d80cfca0073bd62ad27aac793a0d5e785c
Make undef use ck_fun and OA_SCALARREF

In regen/opcodes, we have some operators that use ck_fun and have R
for the argument.  And there are some that use ck_lfun and have S for
the argument.

These both amount to more or less the same thing.

ck_fun/R goes through the OA_SCALARREF case in ck_fun, which calls
op_lvalue(scalar()) on the child op.

ck_lfun/S goes through the OA_SCALAR case in ck_fun, which calls
scalar(), and then ck_lfun sees to it that op_lvalue is called.

The only real difference is that the OA_SCALAR case makes sure there
are not too many arguments.

Since both core_prototype and pp_coreargs need special cases to deal
with OA_SCALAR that is really ‘supposed’ to be OA_SCALARREF, it
becomes simpler to add &CORE::undef if undef uses R.  In that case,
we also have to put the argument-checking in the OA_SCALARREF, but we
make it conditional on the op being an undef op, for the sake of doing
one thing at a time.  (This is a bit of a mess; see ticket #96006.)
op.c
opcode.h
regen/opcodes