зеркало из https://github.com/github/ruby.git
Use VALUE for callinfos that are on the heap (https://github.com/Shopify/ruby/pull/420)
Yet another case of `jit_mov_gc_ptr()` being yanked out during the
transition to the new backend, causing a crash after object movement.
The intresting wrinkle with this one is that not all callinfos are GC'ed
objects, so the old code had an implicit assumption.
b0b9f7201a/yjit/src/codegen.rs (L4087-L4095)
This commit is contained in:
Родитель
5114ddce3f
Коммит
342459576d
|
@ -4033,8 +4033,11 @@ fn gen_send_cfunc(
|
|||
if !kw_arg.is_null() {
|
||||
// Build a hash from all kwargs passed
|
||||
asm.comment("build_kwhash");
|
||||
let imemo_ci = VALUE(ci as usize);
|
||||
assert_ne!(0, unsafe { rb_IMEMO_TYPE_P(imemo_ci, imemo_callinfo) },
|
||||
"we assume all callinfos with kwargs are on the GC heap");
|
||||
let sp = asm.lea(ctx.sp_opnd(0));
|
||||
let kwargs = asm.ccall(build_kwhash as *const u8, vec![Opnd::UImm(ci as u64), sp]);
|
||||
let kwargs = asm.ccall(build_kwhash as *const u8, vec![imemo_ci.into(), sp]);
|
||||
|
||||
// Replace the stack location at the start of kwargs with the new hash
|
||||
let stack_opnd = ctx.stack_opnd(argc - passed_argc);
|
||||
|
|
Загрузка…
Ссылка в новой задаче