summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-15 13:13:13 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-15 13:13:13 +0000
commit8514a89ddb9f1e33f9830c00e00db83cbd8945f9 (patch)
tree1355fc0bf82a2c78ec049ad3a7824925c793e37c
parent1c9bf1abe6189b92813de66c079089c394103ec8 (diff)
parent5f438a9a23e13957a6f27a6c29850d4dce382023 (diff)
downloadperl-8514a89ddb9f1e33f9830c00e00db83cbd8945f9.tar.gz
Integrate perlio:
[ 10597] Check that HVs with HvNAME() != NULL are really stashes before treating them as such. Also be more defensive on the GvCV. Win32 fork and dprof now working again. [ 10595] Skip Perl_my_bcopy in .def file as we do not provide it. - Win32 (VC++) now builds but fails: filefind.t - suspect Win32's builtin cwd is not doing insecure dir test fork.t - No &___ENV_HV_NAME___::CLONE method ??? write.t - open(...,"|-") not implemented on Win32 p4raw-link: @10597 on //depot/perlio: 5f438a9a23e13957a6f27a6c29850d4dce382023 p4raw-link: @10595 on //depot/perlio: 9d50d3997b5daf2ecaed7d0cafc86ab4121491bc p4raw-id: //depot/perl@10598
-rw-r--r--makedef.pl1
-rw-r--r--sv.c34
2 files changed, 22 insertions, 13 deletions
diff --git a/makedef.pl b/makedef.pl
index 300f9e8219..87e34b489a 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -223,6 +223,7 @@ if ($PLATFORM eq 'win32') {
Perl_dump_fds
Perl_init_thread_intern
Perl_my_bzero
+ Perl_my_bcopy
Perl_my_htonl
Perl_my_ntohl
Perl_my_swap
diff --git a/sv.c b/sv.c
index 6b6e0636d8..4352fd4e79 100644
--- a/sv.c
+++ b/sv.c
@@ -8159,6 +8159,9 @@ Perl_sv_dup(pTHX_ SV *sstr)
}
HvPMROOT((HV*)dstr) = HvPMROOT((HV*)sstr); /* XXX */
HvNAME((HV*)dstr) = SAVEPV(HvNAME((HV*)sstr));
+ /* If HvNAME() is set hv _may_ be a stash
+ - record it for possible callback
+ */
if(HvNAME((HV*)dstr))
av_push(PL_clone_callbacks, dstr);
break;
@@ -9307,21 +9310,26 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_ptr_table = NULL;
}
+ /* For the (possible) stashes identified above
+ - check that they are stashes
+ - if they are see if the ->CLONE method is defined
+ - if it is call it
+ */
while(av_len(PL_clone_callbacks) != -1) {
HV* stash = (HV*) av_shift(PL_clone_callbacks);
- CV* cloner = (CV*) gv_fetchmethod_autoload(stash,"CLONE",0);
- if(cloner) {
- dSP;
- cloner = GvCV(cloner);
- ENTER;
- SAVETMPS;
- PUSHMARK(SP);
- XPUSHs(newSVpv(HvNAME(stash),0));
- PUTBACK;
- call_sv((SV*)cloner, G_DISCARD);
- FREETMPS;
- LEAVE;
-
+ if (gv_stashpv(HvNAME(stash),0)) {
+ GV* cloner = gv_fetchmethod_autoload(stash,"CLONE",0);
+ if (cloner && GvCV(cloner)) {
+ dSP;
+ ENTER;
+ SAVETMPS;
+ PUSHMARK(SP);
+ XPUSHs(newSVpv(HvNAME(stash),0));
+ PUTBACK;
+ call_sv((SV*)GvCV(cloner), G_DISCARD);
+ FREETMPS;
+ LEAVE;
+ }
}
}