From 98ce67cb64ba29be3aa5fd5b81012a3aab873b8e Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sun, 8 Jan 2023 11:35:38 +0100 Subject: regcomp_study.c - disable CURLYX optimizations when EVAL has been seen anywhere Historically we disabled CURLYX optimizations when they *contained* an EVAL, on the assumption that the optimization might affect how many times, etc, the eval was called. However, this is also true for CURLYX with evals *afterwards*. If the CURLYN or CURLYM optimization can prune off the search space, then an eval afterwards will be affected. An when you take into account GOSUB, it means that an eval in front might be affected by an optimization after it. So for now we disable CURLYN and CURLYM in any pattern with an EVAL. --- regcomp_debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'regcomp_debug.c') diff --git a/regcomp_debug.c b/regcomp_debug.c index 74f080a9d9..589ca6991f 100644 --- a/regcomp_debug.c +++ b/regcomp_debug.c @@ -83,8 +83,12 @@ Perl_debug_studydata(pTHX_ const char *where, scan_data_t *data, DECLARE_AND_GET_RE_DEBUG_FLAGS; DEBUG_OPTIMISE_MORE_r({ - if (!data) + if (!data) { + Perl_re_indentf(aTHX_ "%s: NO DATA", + depth, + where); return; + } Perl_re_indentf(aTHX_ "%s: M/S/D: %" IVdf "/%" IVdf "/%" IVdf " Pos:%" IVdf "/%" IVdf " Flags: 0x%" UVXf, depth, where, -- cgit v1.2.1