Skip to content

Commit da81b5c

Browse files
committed
Reapply "Merge branch 'PHP-8.3' into PHP-8.4"
This reverts commit 83ca374, and fixes the previous bad merge.
1 parent 83ca374 commit da81b5c

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
?? ??? ????, PHP 8.4.2
4+
5+
- Opcache:
6+
. Fixed bug GH-16851 (JIT_G(enabled) not set correctly on other threads).
7+
(dktapps)
8+
39
21 Nov 2024, PHP 8.4.1
410

511
- BcMath:

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3282,6 +3282,7 @@ static zend_result accel_post_startup(void)
32823282
zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Could not enable JIT: could not use reserved buffer!");
32833283
} else {
32843284
zend_jit_startup(ZSMMG(reserved), jit_size, reattached);
3285+
zend_jit_startup_ok = true;
32853286
}
32863287
}
32873288
#endif

ext/opcache/jit/zend_jit.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ zend_jit_globals jit_globals;
6969
#define JIT_STUB_PREFIX "JIT$$"
7070
#define TRACE_PREFIX "TRACE-"
7171

72+
bool zend_jit_startup_ok = false;
73+
7274
zend_ulong zend_jit_profile_counter = 0;
7375
int zend_jit_profile_counter_rid = -1;
7476

@@ -3634,6 +3636,13 @@ static void zend_jit_reset_counters(void)
36343636

36353637
void zend_jit_activate(void)
36363638
{
3639+
#ifdef ZTS
3640+
if (!zend_jit_startup_ok) {
3641+
JIT_G(enabled) = 0;
3642+
JIT_G(on) = 0;
3643+
return;
3644+
}
3645+
#endif
36373646
zend_jit_profile_counter = 0;
36383647
if (JIT_G(on)) {
36393648
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_COUNTERS) {

ext/opcache/jit/zend_jit.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ typedef struct _zend_jit_trace_rec zend_jit_trace_rec;
100100
typedef struct _zend_jit_trace_stack_frame zend_jit_trace_stack_frame;
101101
typedef struct _sym_node zend_sym_node;
102102

103+
extern bool zend_jit_startup_ok;
104+
103105
typedef struct _zend_jit_globals {
104106
bool enabled;
105107
bool on;

0 commit comments

Comments
 (0)