From 3edf5c969a9f5f3290852ab9edf61a876fca63d0 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 14 Jan 2021 08:16:27 +0300 Subject: [PATCH] Fixed bug #80422 (php_opcache.dll crashes when using Apache 2.4 with JIT) --- NEWS | 4 ++++ ext/opcache/jit/zend_jit_trace.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index d27f9b34c8..60172e52e2 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,10 @@ PHP NEWS - ODBC: . Fixed bug #80592 (all floats are the same in ODBC parameters). (cmb) +- Opcache: + . Fixed bug #80422 (php_opcache.dll crashes when using Apache 2.4 with JIT). + (Dmitry) + - PDO_Firebird: . Fixed bug #80521 (Parameters with underscores no longer recognized). (cmb, Simonov Denis) diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 853be7517a..69c4f79fa8 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -7629,6 +7629,11 @@ static void zend_jit_trace_init_caches(void) static void zend_jit_trace_reset_caches(void) { JIT_G(tracing) = 0; +#ifdef ZTS + if (!JIT_G(exit_counters)) { + JIT_G(exit_counters) = calloc(JIT_G(max_exit_counters), 1); + } +#endif } static void zend_jit_trace_restart(void) -- 2.40.0