Note why we need a seemingly useless empty &Regexp::DESTROY
authorNicholas Clark <nick@ccl4.org>
Tue, 31 Mar 2009 09:33:22 +0000 (10:33 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 31 Mar 2009 09:34:01 +0000 (10:34 +0100)
universal.c

index 6041c6d..1a76cfd 100644 (file)
@@ -296,6 +296,7 @@ Perl_boot_core_UNIVERSAL(pTHX)
                XS_Internals_hv_clear_placehold, file, "\\%");
     newXSproto("PerlIO::get_layers",
                XS_PerlIO_get_layers, file, "*;@");
+    /* Providing a Regexp::DESTROY fixes #21347. See test in t/op/ref.t  */
     CvFILE(newCONSTSUB(get_hv("Regexp::", GV_ADD), "DESTROY", NULL))
        = (char *)file;
     newXSproto("Internals::hash_seed",XS_Internals_hash_seed, file, "");