diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-05-27 17:45:50 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-05-27 17:46:08 -0700 |
commit | 4587c5322c964beac01a38188957ca11026dc766 (patch) | |
tree | 8b4a16d53c35dd055d52433514ba82f9e52ec951 /pp_hot.c | |
parent | 717a97bab95e1c5b372d6ecc681398092afcffd6 (diff) | |
download | perl-4587c5322c964beac01a38188957ca11026dc766.tar.gz |
[perl #117947] Verify lvalueness of XSUBs at run time
If the sub is not visible at compile time, the op tree is flagged such
that pp_entersub will know whether to check the lvalueness of the
called sub.
That check has been in pp_entersub since da1dff9483c. When I moved
it to pp_entersub in that commit, I only added it to the pure-Perl
branch, not to the XS branch, allowing all XSUBs to be treated as
lvalues if they are not visible at compile time.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2847,6 +2847,12 @@ try_autoload: PUTBACK; + if (((PL_op->op_private + & PUSHSUB_GET_LVALUE_MASK(Perl_is_lvalue_sub) + ) & OPpENTERSUB_LVAL_MASK) == OPpLVAL_INTRO && + !CvLVALUE(cv)) + DIE(aTHX_ "Can't modify non-lvalue subroutine call"); + if (!hasargs) { /* Need to copy @_ to stack. Alternative may be to * switch stack to @_, and copy return values |