Skip to content

Commit f3027d5

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 b5c8b91 commit f3027d5

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
@@ -571,10 +571,12 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
571571
zend_op *end = new_opcodes + op_array->last;
572572
int offset = 0;
573573

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

579581
for (; opline < end ; opline++, offset++) {
580582
#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)