Skip to content

Commit 659c907

Browse files
committed
.
1 parent dcfbbdc commit 659c907

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zjit/src/codegen.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ fn gen_insn(cb: &mut CodeBlock, jit: &mut JITState, asm: &mut Assembler, functio
498498
Insn::LoadPC => gen_load_pc(asm),
499499
Insn::LoadEC => gen_load_ec(),
500500
Insn::LoadSelf => gen_load_self(),
501-
&Insn::LoadField { recv, id, offset, return_type: _ } => gen_load_field(asm, opnd!(recv), id, offset),
501+
&Insn::LoadField { recv, id, offset, return_type } => gen_load_field(asm, opnd!(recv), id, offset, return_type),
502502
&Insn::StoreField { recv, id, offset, val } => no_output!(gen_store_field(asm, opnd!(recv), id, offset, opnd!(val), function.type_of(val))),
503503
&Insn::WriteBarrier { recv, val } => no_output!(gen_write_barrier(asm, opnd!(recv), opnd!(val), function.type_of(val))),
504504
&Insn::IsBlockGiven => gen_is_block_given(jit, asm),
@@ -1130,10 +1130,10 @@ fn gen_load_self() -> Opnd {
11301130
Opnd::mem(64, CFP, RUBY_OFFSET_CFP_SELF)
11311131
}
11321132

1133-
fn gen_load_field(asm: &mut Assembler, recv: Opnd, id: ID, offset: i32) -> Opnd {
1133+
fn gen_load_field(asm: &mut Assembler, recv: Opnd, id: ID, offset: i32, return_type: Type) -> Opnd {
11341134
asm_comment!(asm, "Load field id={} offset={}", id.contents_lossy(), offset);
11351135
let recv = asm.load(recv);
1136-
asm.load(Opnd::mem(64, recv, offset))
1136+
asm.load(Opnd::mem(return_type.num_bits(), recv, offset))
11371137
}
11381138

11391139
fn gen_store_field(asm: &mut Assembler, recv: Opnd, id: ID, offset: i32, val: Opnd, val_type: Type) {

0 commit comments

Comments
 (0)