&CORE::lock()
authorFather Chrysostomos <sprout@cpan.org>
Wed, 24 Aug 2011 16:09:58 +0000 (09:09 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 26 Aug 2011 19:43:13 +0000 (12:43 -0700)
commitc72a562989087cf45b7abfdbbfb4a823adac1604
treeee17c214b370828ec404011e889a3c7958aa632f
parentd3e26383b699ba248aece0da481bcd07d3e4aa60
&CORE::lock()

This commit allows &CORE::lock to be called through references and
via ampersand syntax.  It adds code to pp_coreargs for handling the
OA_SCALARREF case, though what it adds is currently lock-specific.
(Subsequent commits will address that.)  Since lock returns the scalar
passed to it, not a copy, &CORE::lock needs to use op_leavesublv,
rather than op_leavesub.  But it can’t be an lvalue sub, as
&CORE::lock = 3 should be disallowed.  So we use the sneaky trick of
turning on the lvalue flag before attaching the op tree to the sub
(which causes newATTRSUB to use op_leavesublv), and then turning it
off afterwards.
gv.c
pp.c
pp_ctl.c
t/op/coresubs.t