Skip to content

Commit 07240e9

Browse files
authored
Make gen_opt_aref() delegate to gen_opt_send_without_block() (#9)
Basically mirroring the interpreter for the general case.
1 parent 95ca935 commit 07240e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

yjit_codegen.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,8 @@ gen_opt_gt(jitstate_t* jit, ctx_t* ctx)
11241124
return gen_fixnum_cmp(jit, ctx, cmovg);
11251125
}
11261126

1127+
static codegen_status_t gen_opt_send_without_block(jitstate_t *jit, ctx_t *ctx);
1128+
11271129
static codegen_status_t
11281130
gen_opt_aref(jitstate_t *jit, ctx_t *ctx)
11291131
{
@@ -1265,8 +1267,10 @@ gen_opt_aref(jitstate_t *jit, ctx_t *ctx)
12651267
jit_jump_to_next_insn(jit, ctx);
12661268
return YJIT_END_BLOCK;
12671269
}
1268-
1269-
return YJIT_CANT_COMPILE;
1270+
else {
1271+
// General case. Call the [] method.
1272+
return gen_opt_send_without_block(jit, ctx);
1273+
}
12701274
}
12711275

12721276
static codegen_status_t

0 commit comments

Comments
 (0)