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>
This commit is contained in:
Jean byroot Boussier 2023-11-07 16:49:36 +01:00 committed by GitHub
parent 96557bc276
commit a294bb844c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) }
};