Skip to content

Commit a294bb8

Browse files
casperisfinebyroot
andauthored
YJIT: handle out of shape situation in gen_setinstancevariable (#8857)
If the VM ran out of shape, `rb_shape_transition_shape_capa` might return `OBJ_TOO_COMPLEX_SHAPE`. Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
1 parent 96557bc commit a294bb8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

yjit/src/codegen.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,11 @@ fn gen_setinstancevariable(
24732473
};
24742474

24752475
let dest_shape = if let Some(capa_shape) = capa_shape {
2476-
unsafe { rb_shape_get_next(capa_shape, comptime_receiver, ivar_name) }
2476+
if OBJ_TOO_COMPLEX_SHAPE_ID == unsafe { rb_shape_id(capa_shape) } {
2477+
capa_shape
2478+
} else {
2479+
unsafe { rb_shape_get_next(capa_shape, comptime_receiver, ivar_name) }
2480+
}
24772481
} else {
24782482
unsafe { rb_shape_get_next(shape, comptime_receiver, ivar_name) }
24792483
};

0 commit comments

Comments
 (0)