From: Jarkko Hietaniemi Date: Sun, 16 Apr 2006 12:26:48 +0000 (+0300) Subject: (tentative) regcomp.c: try convincing Coverity that data ptr in study_chunk is non... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d3527ba35fbfe949eb3b9b4a0da66b688e41a00;p=p5sagit%2Fp5-mst-13.2.git (tentative) regcomp.c: try convincing Coverity that data ptr in study_chunk is non-NULL when needed Message-Id: <20060416092648.812D36CF2D@aprikoosi.hut.fi> Date: Sun, 16 Apr 2006 12:26:48 +0300 (EEST) p4raw-id: //depot/perl@27869 --- diff --git a/regcomp.c b/regcomp.c index 663b343..a820e5a 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1733,6 +1733,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, I32 *deltap, } if (code == IFTHEN && num < 2) /* Empty ELSE branch */ min1 = 0; + if ((flags & (SCF_DO_SUBSTR | SCF_DO_STCLASS)) && !data) + Perl_croak(aTHX_ "panic: null data in study_chunk"); if (flags & SCF_DO_SUBSTR) { data->pos_min += min1; data->pos_delta += max1 - min1;