Skip to content

Commit e502aaf

Browse files
committed
Prevent starting JIT on x86_64 with buffuer size above 2G
1 parent c1a37c4 commit e502aaf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/opcache/jit/zend_jit.c

+7
Original file line numberDiff line numberDiff line change
@@ -3414,6 +3414,13 @@ ZEND_EXT_API int zend_jit_check_support(void)
34143414
JIT_G(on) = 0;
34153415
return FAILURE;
34163416
}
3417+
#elif defined(IR_TARGET_X64)
3418+
if (JIT_G(buffer_size) > 2 * Z_L(1024*1024*1024)) {
3419+
zend_error(E_WARNING, "JIT on x86_64 doesn't support opcache.jit_buffer_size above 2G.");
3420+
JIT_G(enabled) = 0;
3421+
JIT_G(on) = 0;
3422+
return FAILURE;
3423+
}
34173424
#endif
34183425

34193426
return SUCCESS;

0 commit comments

Comments
 (0)