diff options
author | Jean byroot Boussier <jean.boussier+github@shopify.com> | 2023-11-07 16:49:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 10:49:36 -0500 |
commit | a294bb844c697799d8ba766aa2e5ba5449d05448 (patch) | |
tree | 46f50c7c2c14303b3b9d42b3a6480fad9ade49b3 /yjit | |
parent | 96557bc2762bdb8917f659c3290d9ba18eae6152 (diff) |
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>
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/codegen.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index ba2a23872e..8f668bcf86 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -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) } }; |