@@ -634,7 +634,8 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
634
634
635
635
#ifdef HAVE_JIT
636
636
if (ZCG (accel_directives ).jit &&
637
- ZEND_JIT_LEVEL (ZCG (accel_directives ).jit ) <= ZEND_JIT_LEVEL_OPT_FUNCS ) {
637
+ ZEND_JIT_LEVEL (ZCG (accel_directives ).jit ) <= ZEND_JIT_LEVEL_OPT_FUNCS &&
638
+ !ZCG (current_persistent_script )-> corrupted ) {
638
639
zend_jit_op_array (op_array , ZCG (current_persistent_script ) ? & ZCG (current_persistent_script )-> script : NULL );
639
640
}
640
641
#endif
@@ -1118,10 +1119,6 @@ static void zend_accel_persist_class_table(HashTable *class_table)
1118
1119
1119
1120
zend_persistent_script * zend_accel_script_persist (zend_persistent_script * script , const char * * key , unsigned int key_length , int for_shm )
1120
1121
{
1121
- #ifdef HAVE_JIT
1122
- zend_long orig_jit = 0 ;
1123
- #endif
1124
-
1125
1122
script -> mem = ZCG (mem );
1126
1123
1127
1124
ZEND_ASSERT (((zend_uintptr_t )ZCG (mem ) & 0x7 ) == 0 ); /* should be 8 byte aligned */
@@ -1152,13 +1149,8 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
1152
1149
ZCG (mem ) = (void * )((char * )ZCG (mem ) + script -> arena_size );
1153
1150
1154
1151
#ifdef HAVE_JIT
1155
- if (ZCG (accel_directives ).jit ) {
1156
- if (key ) {
1157
- zend_jit_unprotect ();
1158
- } else {
1159
- orig_jit = ZCG (accel_directives ).jit ;
1160
- ZCG (accel_directives ).jit = 0 ;
1161
- }
1152
+ if (ZCG (accel_directives ).jit && for_shm ) {
1153
+ zend_jit_unprotect ();
1162
1154
}
1163
1155
#endif
1164
1156
@@ -1171,13 +1163,11 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
1171
1163
ZCSG (map_ptr_last ) = CG (map_ptr_last );
1172
1164
1173
1165
#ifdef HAVE_JIT
1174
- if (ZCG (accel_directives ).jit ) {
1166
+ if (ZCG (accel_directives ).jit && for_shm ) {
1175
1167
if (ZEND_JIT_LEVEL (ZCG (accel_directives ).jit ) >= ZEND_JIT_LEVEL_OPT_SCRIPT ) {
1176
1168
zend_jit_script (& script -> script );
1177
1169
}
1178
1170
zend_jit_protect ();
1179
- } else if (!key ) {
1180
- ZCG (accel_directives ).jit = orig_jit ;
1181
1171
}
1182
1172
#endif
1183
1173
0 commit comments