From: Hugo van der Sanden Date: Fri, 23 Aug 2002 12:23:31 +0000 (+0000) Subject: #17747 caused bad free()s with PERL_DESTRUCT by calling newXS() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ecdd9a87cdfac3d4938733086a89d685b66dfb5;p=p5sagit%2Fp5-mst-13.2.git #17747 caused bad free()s with PERL_DESTRUCT by calling newXS() with a NULL subaddr. Fix that, and stop it happening again. p4raw-id: //depot/perl@17763 --- diff --git a/op.c b/op.c index 043f0be..5c55f0d 100644 --- a/op.c +++ b/op.c @@ -5217,6 +5217,9 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename) GV_ADDMULTI, SVt_PVCV); register CV *cv; + if (!subaddr) + Perl_croak(aTHX_ "panic: no address for '%s' in '%s'", name, filename); + if ((cv = (name ? GvCV(gv) : Nullcv))) { if (GvCVGEN(gv)) { /* just a cached method */ diff --git a/universal.c b/universal.c index 668fa3b..4a879e9 100644 --- a/universal.c +++ b/universal.c @@ -192,7 +192,6 @@ Perl_boot_core_UNIVERSAL(pTHX) sv_inc(sv); SvSETMAGIC(sv); /* Make it findable via fetchmethod */ - newXS("version::()", NULL, file); newXS("version::new", XS_version_new, file); newXS("version::(\"\"", XS_version_stringify, file); newXS("version::stringify", XS_version_stringify, file);