No need to upgrade if all we're going to do is return.
Nicholas Clark [Fri, 8 Dec 2006 21:09:57 +0000 (21:09 +0000)]
p4raw-id: //depot/perl@29486

util.c

diff --git a/util.c b/util.c
index 114e6ad..3ba64e0 100644 (file)
--- a/util.c
+++ b/util.c
@@ -490,9 +490,9 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags)
            mg->mg_len++;
     }
     s = (U8*)SvPV_force_mutable(sv, len);
-    SvUPGRADE(sv, SVt_PVBM);
     if (len == 0)              /* TAIL might be on a zero-length string. */
        return;
+    SvUPGRADE(sv, SVt_PVBM);
     if (len > 2) {
        const unsigned char *sb;
        const U8 mlen = (len>255) ? 255 : (U8)len;