From 833826ed7ad8c06c336951d9c870315ae4da189e Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 28 Dec 2012 09:44:47 -0700 Subject: [PATCH] regcomp.c: Make sure optimizer handles node; Note for 3018b823 The check that there isn't a simple regnode unknown to the optimizer has been commented out since at least 653099ff2c52a6af02b3894d684593dfe31dcc17 in 1999. This caused us some slow down for a while in the 5.17 release, as I added a regnode and didn't think about it needing to be added to the optimizer. This commit uncomments out the check, but only for debugging builds, so that a production environment will run with missing optimization, but developers will be notified of their error. Also, in commit 3018b823898645e44b8c37c70ac5c6302b031381, I made an error in the commit message; I'm adding it here so people digging will find out the relevant information. The message said that the new regex ops were unknown to the optimizer. I had forgotten that I had included them in that commit, so that statement was wrong. --- regcomp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/regcomp.c b/regcomp.c index 35fd196..bee52b0 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4140,8 +4140,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, case SANY: default: - do_default: - /* Perl_croak(aTHX_ "panic: unexpected simple REx opcode %d", OP(scan)); */ +#ifdef DEBUGGING + Perl_croak(aTHX_ "panic: unexpected simple REx opcode %d", OP(scan)); +#endif + do_default: if (flags & SCF_DO_STCLASS_OR) /* Allow everything */ cl_anything(pRExC_state, data->start_class); break; -- 2.7.4