Skip to content

Commit

Permalink
Prevent starting JIT on x86_64 with buffuer size above 2G
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Dec 4, 2023
1 parent c1a37c4 commit e502aaf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/opcache/jit/zend_jit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3414,6 +3414,13 @@ ZEND_EXT_API int zend_jit_check_support(void)
JIT_G(on) = 0;
return FAILURE;
}
#elif defined(IR_TARGET_X64)
if (JIT_G(buffer_size) > 2 * Z_L(1024*1024*1024)) {
zend_error(E_WARNING, "JIT on x86_64 doesn't support opcache.jit_buffer_size above 2G.");
JIT_G(enabled) = 0;
JIT_G(on) = 0;
return FAILURE;
}
#endif

return SUCCESS;
Expand Down

0 comments on commit e502aaf

Please sign in to comment.