X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.c;h=c9f2e275266516c43c6b132c6bfa1b0340c2f815;hb=d41c018a580ac2dafca04b156c937ada656fd14b;hp=fbf7ed00c923f4e7a64ebfe56fc451140bb0460c;hpb=4ea1d5509b412a58fa64cd5ebc1ea31750b05303;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.c b/sv.c index fbf7ed0..c9f2e27 100644 --- a/sv.c +++ b/sv.c @@ -809,14 +809,14 @@ static const struct body_details bodies_by_type[] = { /* 8 bytes on most ILP32 with IEEE doubles */ {sizeof(xpv_allocated), copy_length(XPV, xpv_len) - + relative_STRUCT_OFFSET(XPV, xpv_allocated, xpv_cur), - - relative_STRUCT_OFFSET(XPV, xpv_allocated, xpv_cur), + - relative_STRUCT_OFFSET(xpv_allocated, XPV, xpv_cur), + + relative_STRUCT_OFFSET(xpv_allocated, XPV, xpv_cur), FALSE, NONV, HASARENA}, /* 12 */ {sizeof(xpviv_allocated), copy_length(XPVIV, xiv_u) - + relative_STRUCT_OFFSET(XPVIV, xpviv_allocated, xpv_cur), - - relative_STRUCT_OFFSET(XPVIV, xpviv_allocated, xpv_cur), + - relative_STRUCT_OFFSET(xpviv_allocated, XPVIV, xpv_cur), + + relative_STRUCT_OFFSET(xpviv_allocated, XPVIV, xpv_cur), FALSE, NONV, HASARENA}, /* 20 */ {sizeof(XPVNV), copy_length(XPVNV, xiv_u), 0, FALSE, HADNV, HASARENA}, @@ -831,14 +831,14 @@ static const struct body_details bodies_by_type[] = { /* 20 */ {sizeof(xpvav_allocated), copy_length(XPVAV, xmg_stash) - + relative_STRUCT_OFFSET(XPVAV, xpvav_allocated, xav_fill), - - relative_STRUCT_OFFSET(XPVAV, xpvav_allocated, xav_fill), + - relative_STRUCT_OFFSET(xpvav_allocated, XPVAV, xav_fill), + + relative_STRUCT_OFFSET(xpvav_allocated, XPVAV, xav_fill), TRUE, HADNV, HASARENA}, /* 20 */ {sizeof(xpvhv_allocated), copy_length(XPVHV, xmg_stash) - + relative_STRUCT_OFFSET(XPVHV, xpvhv_allocated, xhv_fill), - - relative_STRUCT_OFFSET(XPVHV, xpvhv_allocated, xhv_fill), + - relative_STRUCT_OFFSET(xpvhv_allocated, XPVHV, xhv_fill), + + relative_STRUCT_OFFSET(xpvhv_allocated, XPVHV, xhv_fill), TRUE, HADNV, HASARENA}, /* 76 */ {sizeof(XPVCV), sizeof(XPVCV), 0, TRUE, HADNV, HASARENA}, @@ -2350,7 +2350,6 @@ char * Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) { register char *s; - int olderrno; if (!sv) { if (lp) @@ -2509,11 +2508,12 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) SvIsUV_on(sv); } else if (SvNOKp(sv)) { + const int olderrno = errno; if (SvTYPE(sv) < SVt_PVNV) sv_upgrade(sv, SVt_PVNV); /* The +20 is pure guesswork. Configure test needed. --jhi */ s = SvGROW_mutable(sv, NV_DIG + 20); - olderrno = errno; /* some Xenix systems wipe out errno here */ + /* some Xenix systems wipe out errno here */ #ifdef apollo if (SvNVX(sv) == 0.0) (void)strcpy(s,"0"); @@ -6704,7 +6704,7 @@ Perl_sv_2io(pTHX_ SV *sv) Perl_croak(aTHX_ PL_no_usym, "filehandle"); if (SvROK(sv)) return sv_2io(SvRV(sv)); - gv = gv_fetchsv(sv, FALSE, SVt_PVIO); + gv = gv_fetchsv(sv, 0, SVt_PVIO); if (gv) io = GvIO(gv); else @@ -6721,6 +6721,7 @@ Perl_sv_2io(pTHX_ SV *sv) Using various gambits, try to get a CV from an SV; in addition, try if possible to set C<*st> and C<*gvp> to the stash and GV associated with it. +The flags in C are passed to sv_fetchsv. =cut */ @@ -6733,7 +6734,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref) CV *cv = Nullcv; if (!sv) - return *gvp = Nullgv, Nullcv; + return *st = NULL, *gvp = Nullgv, Nullcv; switch (SvTYPE(sv)) { case SVt_PVCV: *st = CvSTASH(sv); @@ -6741,6 +6742,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref) return (CV*)sv; case SVt_PVHV: case SVt_PVAV: + *st = NULL; *gvp = Nullgv; return Nullcv; case SVt_PVGV: @@ -6772,8 +6774,10 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref) else gv = gv_fetchsv(sv, lref, SVt_PVCV); *gvp = gv; - if (!gv) + if (!gv) { + *st = NULL; return Nullcv; + } *st = GvESTASH(gv); fix_gv: if (lref && !GvCVu(gv)) { @@ -10232,6 +10236,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_minus_p = proto_perl->Iminus_p; PL_minus_l = proto_perl->Iminus_l; PL_minus_a = proto_perl->Iminus_a; + PL_minus_E = proto_perl->Iminus_E; PL_minus_F = proto_perl->Iminus_F; PL_doswitches = proto_perl->Idoswitches; PL_dowarn = proto_perl->Idowarn;