Skip to content

Commit

Permalink
YJIT: handle out of shape situation in gen_setinstancevariable (#8857)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
casperisfine and byroot committed Nov 7, 2023
1 parent 96557bc commit a294bb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yjit/src/codegen.rs
Expand Up @@ -2473,7 +2473,11 @@ fn gen_setinstancevariable(
};

let dest_shape = if let Some(capa_shape) = capa_shape {
unsafe { rb_shape_get_next(capa_shape, comptime_receiver, ivar_name) }
if OBJ_TOO_COMPLEX_SHAPE_ID == unsafe { rb_shape_id(capa_shape) } {
capa_shape
} else {
unsafe { rb_shape_get_next(capa_shape, comptime_receiver, ivar_name) }
}
} else {
unsafe { rb_shape_get_next(shape, comptime_receiver, ivar_name) }
};
Expand Down

0 comments on commit a294bb8

Please sign in to comment.