summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embed.h2
-rw-r--r--op.c12
-rw-r--r--opcode.h2
-rwxr-xr-xopcode.pl2
-rw-r--r--pp.sym1
-rw-r--r--pp_pack.c3
-rw-r--r--pp_proto.h1
7 files changed, 19 insertions, 4 deletions
diff --git a/embed.h b/embed.h
index 63866762ab..e6d51b5ad7 100644
--- a/embed.h
+++ b/embed.h
@@ -2195,6 +2195,7 @@
#define ck_substr Perl_ck_substr
#define ck_svconst Perl_ck_svconst
#define ck_trunc Perl_ck_trunc
+#define ck_unpack Perl_ck_unpack
#define pp_aassign Perl_pp_aassign
#define pp_abs Perl_pp_abs
#define pp_accept Perl_pp_accept
@@ -4687,6 +4688,7 @@
#define ck_substr(a) Perl_ck_substr(aTHX_ a)
#define ck_svconst(a) Perl_ck_svconst(aTHX_ a)
#define ck_trunc(a) Perl_ck_trunc(aTHX_ a)
+#define ck_unpack(a) Perl_ck_unpack(aTHX_ a)
#define pp_aassign() Perl_pp_aassign(aTHX)
#define pp_abs() Perl_pp_abs(aTHX)
#define pp_accept() Perl_pp_accept(aTHX)
diff --git a/op.c b/op.c
index 806c07f5fe..e0d7f547ab 100644
--- a/op.c
+++ b/op.c
@@ -6191,6 +6191,18 @@ Perl_ck_trunc(pTHX_ OP *o)
}
OP *
+Perl_ck_unpack(pTHX_ OP *o)
+{
+ OP *kid = cLISTOPo->op_first;
+ if (kid->op_sibling) {
+ kid = kid->op_sibling;
+ if (!kid->op_sibling)
+ kid->op_sibling = newDEFSVOP();
+ }
+ return ck_fun(o);
+}
+
+OP *
Perl_ck_substr(pTHX_ OP *o)
{
o = ck_fun(o);
diff --git a/opcode.h b/opcode.h
index 4de3dee137..51255989ec 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1254,7 +1254,7 @@ EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = {
MEMBER_TO_FPTR(Perl_ck_rvconst), /* rv2hv */
MEMBER_TO_FPTR(Perl_ck_null), /* helem */
MEMBER_TO_FPTR(Perl_ck_null), /* hslice */
- MEMBER_TO_FPTR(Perl_ck_fun), /* unpack */
+ MEMBER_TO_FPTR(Perl_ck_unpack), /* unpack */
MEMBER_TO_FPTR(Perl_ck_fun), /* pack */
MEMBER_TO_FPTR(Perl_ck_split), /* split */
MEMBER_TO_FPTR(Perl_ck_join), /* join */
diff --git a/opcode.pl b/opcode.pl
index e13d14de25..dc5b66eea9 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -633,7 +633,7 @@ hslice hash slice ck_null m@ H L
# Explosives and implosives.
-unpack unpack ck_fun @ S S?
+unpack unpack ck_unpack @ S S?
pack pack ck_fun mst@ S L
split split ck_split t@ S S S
join join or string ck_join mst@ S L
diff --git a/pp.sym b/pp.sym
index f2dbb0bd6b..00d4e7eef3 100644
--- a/pp.sym
+++ b/pp.sym
@@ -43,6 +43,7 @@ Perl_ck_subr
Perl_ck_substr
Perl_ck_svconst
Perl_ck_trunc
+Perl_ck_unpack
Perl_pp_null
Perl_pp_stub
Perl_pp_scalar
diff --git a/pp_pack.c b/pp_pack.c
index 55469fb0ab..3e4993d2e2 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -1707,8 +1707,7 @@ S_unpack_rec(pTHX_ register tempsym_t* symptr, register char *s, char *strbeg, c
PP(pp_unpack)
{
dSP;
- SV *right = (MAXARG > 1) ? POPs : GvSV(PL_defgv);
- SV *left = POPs;
+ dPOPPOPssrl;
I32 gimme = GIMME_V;
STRLEN llen;
STRLEN rlen;
diff --git a/pp_proto.h b/pp_proto.h
index 86311949a7..2f457c37fd 100644
--- a/pp_proto.h
+++ b/pp_proto.h
@@ -42,6 +42,7 @@ PERL_CKDEF(Perl_ck_subr)
PERL_CKDEF(Perl_ck_substr)
PERL_CKDEF(Perl_ck_svconst)
PERL_CKDEF(Perl_ck_trunc)
+PERL_CKDEF(Perl_ck_unpack)
PERL_PPDEF(Perl_pp_null)