Skip to content

Commit 124558e

Browse files
committed
Skip compiling/linking internal classes on Windows and file cache
1 parent f182352 commit 124558e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,8 +1813,16 @@ static zend_persistent_script *opcache_compile_file(zend_file_handle *file_handl
18131813
CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION;
18141814
CG(compiler_options) |= ZEND_COMPILE_IGNORE_OTHER_FILES;
18151815
CG(compiler_options) |= ZEND_COMPILE_IGNORE_OBSERVER;
1816+
#ifdef ZEND_WIN32
1817+
/* On Windows, don't compile with internal classes. Shm may be attached from different
1818+
* processes with internal classes living in different addresses. */
1819+
CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES;
1820+
#endif
18161821
if (ZCG(accel_directives).file_cache) {
18171822
CG(compiler_options) |= ZEND_COMPILE_WITH_FILE_CACHE;
1823+
/* Don't compile with internal classes for file cache, in case some extension is removed
1824+
* later on. We cannot assume it is there in the future. */
1825+
CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES;
18181826
}
18191827
op_array = *op_array_p = accelerator_orig_compile_file(file_handle, type);
18201828
CG(compiler_options) = orig_compiler_options;

0 commit comments

Comments
 (0)