summaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-21 01:37:42 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-21 01:37:42 -0700
commitea5703f415b018a4574fdbed54af0a53bd0e6095 (patch)
tree64de8d4753fea26a5f97ada9d0861c1d6eae4111 /opcode.h
parentf912a4747f84557c46b88101928c48622c8b8624 (diff)
downloadperl-ea5703f415b018a4574fdbed54af0a53bd0e6095.tar.gz
Refactor unpack’s newDEFSVOP logic; correct prototype
unpack is the only op that takes an implicit $_ for its second argu- ment. (For others it’s the first.) Instead of special-casing unpack with its own ck_ routine, we can sim- ply modify the logic in ck_fun to apply OA_DEFGV to the first optional argument, not just the first argument. Currently OA_DEFGV is not set in PL_opargs[OP_UNPACK], which means the automatically-generated prototype is ($;$), instead of ($_). This commit sets the flag on the op, changes it to use ck_fun directly, and updates ck_fun and the prototype-generation code accord- ingly. I couldn’t put this in multiple commits, as the changes are interdependent.
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/opcode.h b/opcode.h
index 0ce4140d60..de1a42d8c8 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1452,7 +1452,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
Perl_ck_null, /* helem */
Perl_ck_null, /* hslice */
Perl_ck_fun, /* boolkeys */
- Perl_ck_unpack, /* unpack */
+ Perl_ck_fun, /* unpack */
Perl_ck_fun, /* pack */
Perl_ck_split, /* split */
Perl_ck_join, /* join */
@@ -1836,7 +1836,7 @@ EXTCONST U32 PL_opargs[] = {
0x00014204, /* helem */
0x00024401, /* hslice */
0x00004b00, /* boolkeys */
- 0x00091400, /* unpack */
+ 0x00091480, /* unpack */
0x0002140d, /* pack */
0x00111408, /* split */
0x0002140d, /* join */