diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-09 23:09:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-09 23:09:40 +0000 |
commit | 837485b6cd4b757519a4ac6f03f3857c2fcf4844 (patch) | |
tree | f8a5bcaa5cc60df2da6db55f7faced65ca3a55f1 /pp_ctl.c | |
parent | 565764a853a177193a027e73655fad354d57fc10 (diff) | |
parent | ef50df4b2435a16251e94335bad8aa9485e4478c (diff) | |
download | perl-837485b6cd4b757519a4ac6f03f3857c2fcf4844.tar.gz |
[asperl] integrate win32 branch contents
p4raw-id: //depot/asperl@493
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -91,10 +91,12 @@ PP(pp_regcomp) { else { t = SvPV(tmpstr, len); - /* JMR: Check against the last compiled regexp */ - if ( ! pm->op_pmregexp || ! pm->op_pmregexp->precomp - || strnNE(pm->op_pmregexp->precomp, t, len) - || pm->op_pmregexp->precomp[len]) { + /* JMR: Check against the last compiled regexp + To know for sure, we'd need the length of precomp. + But we don't have it, so we must ... take a guess. */ + if (!pm->op_pmregexp || !pm->op_pmregexp->precomp || + memNE(pm->op_pmregexp->precomp, t, len + 1)) + { if (pm->op_pmregexp) { ReREFCNT_dec(pm->op_pmregexp); pm->op_pmregexp = Null(REGEXP*); /* crucial if regcomp aborts */ @@ -552,7 +554,7 @@ PP(pp_grepstart) SAVETMPS; #ifdef USE_THREADS /* SAVE_DEFSV does *not* suffice here */ - save_sptr(av_fetch(thr->threadsv, find_threadsv("_"), FALSE)); + save_sptr(&THREADSV(0)); #else SAVESPTR(GvSV(defgv)); #endif /* USE_THREADS */ @@ -1135,6 +1137,7 @@ PP(pp_caller) register PERL_CONTEXT *cx; I32 dbcxix; I32 gimme; + HV *hv; SV *sv; I32 count = 0; @@ -1164,14 +1167,22 @@ PP(pp_caller) } if (GIMME != G_ARRAY) { - dTARGET; - - sv_setpv(TARG, HvNAME(cx->blk_oldcop->cop_stash)); - PUSHs(TARG); + hv = cx->blk_oldcop->cop_stash; + if (!hv) + PUSHs(&sv_undef); + else { + dTARGET; + sv_setpv(TARG, HvNAME(hv)); + PUSHs(TARG); + } RETURN; } - PUSHs(sv_2mortal(newSVpv(HvNAME(cx->blk_oldcop->cop_stash), 0))); + hv = cx->blk_oldcop->cop_stash; + if (!hv) + PUSHs(&sv_undef); + else + PUSHs(sv_2mortal(newSVpv(HvNAME(hv), 0))); PUSHs(sv_2mortal(newSVpv(SvPVX(GvSV(cx->blk_oldcop->cop_filegv)), 0))); PUSHs(sv_2mortal(newSViv((I32)cx->blk_oldcop->cop_line))); if (!MAXARG) |