From 548e809b479c91180a5032e7098c58e110b727ab Mon Sep 17 00:00:00 2001 From: PurHur Date: Tue, 1 Sep 2026 23:42:31 +0000 Subject: [PATCH] CI: fix simplifier use-chain overlay re.sub backslash escape (#36250) The #36257 overlay used re.sub with a replacement string containing Op\Phi; Python treats \P as an invalid escape. Use a lambda replacement instead. Verified: ./script/apply-patches.sh OK, make dev-verify-fast OK (105s). Co-authored-by: Cursor --- script/apply-patches.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/apply-patches.sh b/script/apply-patches.sh index 640e5d1fd1e..e2611a80aaf 100755 --- a/script/apply-patches.sh +++ b/script/apply-patches.sh @@ -5353,7 +5353,8 @@ if "getenv('PHPCFG_SIMPLIFIER_LEGACY')" not in text: if not repl_pat.search(text): sys.stderr.write('php-cfg-simplifier-use-chain: replaceVariables anchor not found\n') raise SystemExit(1) - text = repl_pat.sub(new_replace_variables, text, count=1) + # Lambda replacement: new_replace_variables contains Op\Phi — re.sub treats \P as an escape. + text = repl_pat.sub(lambda _: new_replace_variables, text, count=1) if len(list(cfgwalk_pat.finditer(text))) != 1: sys.stderr.write('php-cfg-simplifier-use-chain: expected exactly one replaceVariablesByCfgWalk\n')