This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
No point in checking the length before we know whether the pointer
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 27 Jan 2001 00:35:47 +0000 (00:35 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 27 Jan 2001 00:35:47 +0000 (00:35 +0000)
is bogus or not, fixes Abigail's odbm failures in Linux.

p4raw-id: //depot/perl@8555

sv.c

diff --git a/sv.c b/sv.c
index 93188df..ed7ebdc 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3530,16 +3530,17 @@ void
 Perl_sv_setpvn(pTHX_ register SV *sv, register const char *ptr, register STRLEN len)
 {
     register char *dptr;
-    {
-        /* len is STRLEN which is unsigned, need to copy to signed */
-       IV iv = len;
-       assert(iv >= 0);
-    }
+
     SV_CHECK_THINKFIRST(sv);
     if (!ptr) {
        (void)SvOK_off(sv);
        return;
     }
+    else {
+        /* len is STRLEN which is unsigned, need to copy to signed */
+       IV iv = len;
+       assert(iv >= 0);
+    }
     (void)SvUPGRADE(sv, SVt_PV);
 
     SvGROW(sv, len + 1);