Skip to content

Commit c0f5d46

Browse files
committed
Merge branch 'PHP-8.2'
2 parents 3ad2cc7 + fd55b50 commit c0f5d46

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ static size_t tsrm_tls_offset;
152152

153153
#define IS_SIGNED_32BIT(val) ((((intptr_t)(val)) <= 0x7fffffff) && (((intptr_t)(val)) >= (-2147483647 - 1)))
154154

155+
/* Call range is before or after 2GB */
156+
#define MAY_USE_32BIT_ADDR(addr) \
157+
(IS_SIGNED_32BIT((char*)(addr) - (char*)dasm_buf) && \
158+
IS_SIGNED_32BIT((char*)(addr) - (char*)dasm_end))
159+
155160
#define CAN_USE_AVX() (JIT_G(opt_flags) & allowed_opt_flags & ZEND_JIT_CPU_AVX)
156161

157162
/* Not Implemented Yet */
@@ -353,7 +358,7 @@ static size_t tsrm_tls_offset;
353358

354359
|.macro EXT_CALL, func, tmp_reg
355360
| .if X64
356-
|| if (IS_32BIT(dasm_end) && IS_32BIT(func)) {
361+
|| if (MAY_USE_32BIT_ADDR(func)) {
357362
| call qword &func
358363
|| } else {
359364
| LOAD_ADDR tmp_reg, func
@@ -366,7 +371,7 @@ static size_t tsrm_tls_offset;
366371

367372
|.macro EXT_JMP, func, tmp_reg
368373
| .if X64
369-
|| if (IS_32BIT(dasm_end) && IS_32BIT(func)) {
374+
|| if (MAY_USE_32BIT_ADDR(func)) {
370375
| jmp qword &func
371376
|| } else {
372377
| LOAD_ADDR tmp_reg, func

0 commit comments

Comments
 (0)