Skip to content

Commit 59dda86

Browse files
committed
Alternative fix that should cover all cases
there doesn't seem to be a thread post-startup hook that runs after zend_startup_cb() that could be used for this this fix is similar to accel_startup_ok() as seen here: https://github.com/php/php-src/blob/fc1db70f106525e81f9a24539340b7cf2e82e844/ext/opcache/ZendAccelerator.c#L2631-L2634
1 parent 2207da9 commit 59dda86

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4798,7 +4798,7 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
47984798
return FAILURE;
47994799
}
48004800

4801-
if (zend_jit_startup_failed || zend_string_equals_literal_ci(jit, "disable")) {
4801+
if (zend_string_equals_literal_ci(jit, "disable")) {
48024802
JIT_G(enabled) = 0;
48034803
JIT_G(on) = 0;
48044804
return SUCCESS;
@@ -5098,6 +5098,13 @@ static void zend_jit_reset_counters(void)
50985098

50995099
ZEND_EXT_API void zend_jit_activate(void)
51005100
{
5101+
#ifdef ZTS
5102+
if (zend_jit_startup_failed) {
5103+
JIT_G(enabled) = 0;
5104+
JIT_G(on) = 0;
5105+
return;
5106+
}
5107+
#endif
51015108
zend_jit_profile_counter = 0;
51025109
if (JIT_G(on)) {
51035110
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_COUNTERS) {

0 commit comments

Comments
 (0)