Skip to content

Commit 007a4e6

Browse files
committed
Only add opcode handlers to the skip list if the JIT is compiled in and on
The JIT is the only place where the handlers are overwritten.
1 parent 17e372b commit 007a4e6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ext/opcache/zend_persist.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,12 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
572572
zend_op *end = new_opcodes + op_array->last;
573573
int offset = 0;
574574

575-
if (ZCG(mem_checksum_skip_list)) {
575+
#ifdef HAVE_JIT
576+
if (ZCG(mem_checksum_skip_list) && JIT_G(on)) {
576577
/* There is already one skip with 0 repetitions, so we have to subtract one */
577578
mem_checksum_skip_list_add(new_opcodes, sizeof(zend_op) - sizeof(op_array->opcodes[0].handler), op_array->last - 1);
578579
}
580+
#endif
579581

580582
for (; opline < end ; opline++, offset++) {
581583
#if ZEND_USE_ABS_CONST_ADDR

ext/opcache/zend_persist_calc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include "zend_operators.h"
2828
#include "zend_attributes.h"
2929

30+
#ifdef HAVE_JIT
31+
#include "jit/zend_jit.h"
32+
#endif
33+
3034
#define ADD_DUP_SIZE(m,s) ZCG(current_persistent_script)->size += zend_shared_memdup_size((void*)m, s)
3135
#define ADD_SIZE(m) ZCG(current_persistent_script)->size += ZEND_ALIGNED_SIZE(m)
3236

@@ -236,7 +240,11 @@ static void zend_persist_op_array_calc_ex(zend_op_array *op_array)
236240

237241
zend_shared_alloc_register_xlat_entry(op_array->opcodes, op_array->opcodes);
238242
ADD_SIZE(sizeof(zend_op) * op_array->last);
239-
ZCG(mem_checksum_skip_list_count)++;
243+
#ifdef HAVE_JIT
244+
if (JIT_G(on)) {
245+
ZCG(mem_checksum_skip_list_count)++;
246+
}
247+
#endif
240248

241249
if (op_array->filename) {
242250
ADD_STRING(op_array->filename);

0 commit comments

Comments
 (0)