Skip to content

Commit cbb2609

Browse files
committed
Fix windows build
Signed-off-by: Bob Weinand <[email protected]>
1 parent 0950a08 commit cbb2609

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

zend_abstract_interface/jit_utils/jit_blacklist.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ typedef union _zend_op_trace_info {
8989
#define ZEND_OP_TRACE_INFO(opline, offset) \
9090
((zend_op_trace_info*)(((char*)opline) + offset))
9191

92+
#ifndef _WIN32
9293
static int dd_probe_pipes[2];
9394
#endif
95+
#endif
9496

9597
#define ZEND_FUNC_INFO(op_array) \
9698
((zend_func_info*)((op_array)->reserved[zend_func_info_rid]))
@@ -105,7 +107,7 @@ static void zai_jit_find_opcache_handle(void *ext) {
105107

106108
// opcache startup NULLs its handle. MINIT is executed before extension startup.
107109
void zai_jit_minit(void) {
108-
#if PHP_VERSION_ID < 80400
110+
#if PHP_VERSION_ID < 80400 && !defined(_WIN32)
109111
pipe(dd_probe_pipes);
110112
#endif
111113
zend_llist_apply(&zend_extensions, zai_jit_find_opcache_handle);
@@ -208,13 +210,15 @@ void zai_jit_blacklist_function_inlining(zend_op_array *op_array) {
208210

209211
size_t offset = jit_extension->offset;
210212

213+
#ifndef _WIN32
211214
// check whether the op_trace_info is actually readable or EFAULTing
212215
// we can't trust opcache too much here...
213216
char dummy_buf[sizeof(zend_op_trace_info)];
214217
if (write(dd_probe_pipes[1], ZEND_OP_TRACE_INFO(opline, offset), sizeof(zend_op_trace_info)) < 0) {
215218
return;
216219
}
217220
read(dd_probe_pipes[0], dummy_buf, sizeof(zend_op_trace_info));
221+
#endif
218222

219223
if (!(ZEND_OP_TRACE_INFO(opline, offset)->trace_flags & ZEND_JIT_TRACE_BLACKLISTED)) {
220224
bool is_protected_memory = false;

0 commit comments

Comments
 (0)