From 837cb3baceb77ebdb19584af90d9148242208eb6 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 15 Jul 2008 14:51:53 +0000 Subject: [PATCH] Fix use of a variable before it is initialised, introduced by change 34138, spotted by Jerry D. Hedden. I assume that he's compiling with options that enable trace flow analysis from the C compiler. p4raw-id: //depot/perl@34144 --- sv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sv.c b/sv.c index c2b4171..04d6e43 100644 --- a/sv.c +++ b/sv.c @@ -4402,11 +4402,11 @@ Perl_sv_chop(pTHX_ register SV *const sv, register const char *const ptr) } /* SvPVX(sv) may move in SV_CHECK_THINKFIRST(sv), but after this line, nothing uses the value of ptr any more. */ + max_delta = SvLEN(sv) ? SvLEN(sv) : SvCUR(sv); if (ptr <= SvPVX_const(sv)) Perl_croak(aTHX_ "panic: sv_chop ptr=%p, start=%p, end=%p", ptr, SvPVX_const(sv), SvPVX_const(sv) + max_delta); SV_CHECK_THINKFIRST(sv); - max_delta = SvLEN(sv) ? SvLEN(sv) : SvCUR(sv); if (delta > max_delta) Perl_croak(aTHX_ "panic: sv_chop ptr=%p (was %p), start=%p, end=%p", SvPVX_const(sv) + delta, ptr, SvPVX_const(sv), -- 2.7.4