Skip to content

Commit 1709391

Browse files
committed
Test fixing jit
1 parent cd74a77 commit 1709391

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/opcache/jit/tls/zend_jit_tls_darwin.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ zend_result zend_jit_resolve_tsrm_ls_cache_offsets(
3737
}
3838

3939
#if defined(__x86_64__)
40-
size_t *ti;
41-
__asm__ __volatile__(
42-
"leaq __tsrm_ls_cache(%%rip),%0"
43-
: "=r" (ti));
44-
*module_offset = ti[2];
45-
*module_index = ti[1] * 8;
40+
struct tlv_descriptor { void*(*thunk)(struct tlv_descriptor*); uintptr_t key; uintptr_t offset; };
41+
struct tlv_descriptor *desc;
42+
__asm__ __volatile__("leaq __tsrm_ls_cache(%%rip), %0"
43+
: "=r" (desc) );
44+
*module_index = desc->key * sizeof(void*); // module index in bytes (dtv offset)
45+
*module_offset = desc->offset; // offset of _tsrm_ls_cache in TLS block
4646

4747
return SUCCESS;
4848
#endif

0 commit comments

Comments
 (0)