diff options
-rw-r--r-- | embed.h | 2 | ||||
-rw-r--r-- | op.c | 12 | ||||
-rw-r--r-- | opcode.h | 2 | ||||
-rwxr-xr-x | opcode.pl | 2 | ||||
-rw-r--r-- | pp.sym | 1 | ||||
-rw-r--r-- | pp_pack.c | 3 | ||||
-rw-r--r-- | pp_proto.h | 1 |
7 files changed, 19 insertions, 4 deletions
@@ -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) @@ -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); @@ -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 */ @@ -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 @@ -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 @@ -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) |