diff options
author | Yusuke Endoh <[email protected]> | 2021-10-29 01:58:15 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-10-29 10:57:46 +0900 |
commit | c1228f833c5925c01b2aed1544d9c7fc2421e79b (patch) | |
tree | d9adab9bb139a36fa88407938c68a3d1bb6ec482 /tool/ruby_vm/views | |
parent | 92ad520ad0372ad64ece6af6bbb6823e629c5d5b (diff) |
vm_core.h: Avoid unaligned access to ic_serial on 32-bit machine
This caused Bus error on 32 bit Solaris
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5049
Diffstat (limited to 'tool/ruby_vm/views')
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_getinlinecache.erb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_getinlinecache.erb b/tool/ruby_vm/views/_mjit_compile_getinlinecache.erb index 1acfdb7f0b..d4eb4977a4 100644 --- a/tool/ruby_vm/views/_mjit_compile_getinlinecache.erb +++ b/tool/ruby_vm/views/_mjit_compile_getinlinecache.erb @@ -13,9 +13,9 @@ % # compiler: Capture IC values, locking getinlinecache struct iseq_inline_constant_cache_entry *ice = ic->entry; - if (ice != NULL && ice->ic_serial && !status->compile_info->disable_const_cache) { + if (ice != NULL && GET_IC_SERIAL(ice) && !status->compile_info->disable_const_cache) { % # JIT: Inline everything in IC, and cancel the slow path - fprintf(f, " if (vm_inlined_ic_hit_p(0x%"PRIxVALUE", 0x%"PRIxVALUE", (const rb_cref_t *)0x%"PRIxVALUE", %"PRI_SERIALT_PREFIX"u, reg_cfp->ep)) {", ice->flags, ice->value, (VALUE)ice->ic_cref, ice->ic_serial); + fprintf(f, " if (vm_inlined_ic_hit_p(0x%"PRIxVALUE", 0x%"PRIxVALUE", (const rb_cref_t *)0x%"PRIxVALUE", %"PRI_SERIALT_PREFIX"u, reg_cfp->ep)) {", ice->flags, ice->value, (VALUE)ice->ic_cref, GET_IC_SERIAL(ice)); fprintf(f, " stack[%d] = 0x%"PRIxVALUE";\n", b->stack_size, ice->value); fprintf(f, " goto label_%d;\n", pos + insn_len(insn) + (int)dst); fprintf(f, " }"); |