diff options
author | Alan Wu <[email protected]> | 2021-12-06 17:09:52 -0500 |
---|---|---|
committer | Alan Wu <[email protected]> | 2021-12-06 19:24:41 -0500 |
commit | b7ea66bc3228635a87125bea69f01779f75c39de (patch) | |
tree | 3806cf3ddae13c97987ed2c99f8c73db40ab0797 /yjit.c | |
parent | 0209beaca6880eba18eaf15591ff7f8d02b0d208 (diff) |
YJIT: Fix incomplete invalidation from opt_setinlinecache
As part of YJIT's strategy for promoting Ruby constant expressions into
constants in the output native code, the interpreter calls
rb_yjit_constant_ic_update() from opt_setinlinecache.
The block invalidation loop indirectly calls rb_darray_remove_unordered(),
which does a shuffle remove. Because of this, looping with an
incrementing counter like done previously can miss some elements in the
array. Repeatedly invalidate the first element instead.
The bug this commit resolves does not seem to cause crashes or divergent
behaviors.
Co-authored-by: Jemma Issroff <[email protected]>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5221
Diffstat (limited to 'yjit.c')
-rw-r--r-- | yjit.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -187,7 +187,7 @@ void rb_yjit_iseq_mark(const struct rb_iseq_constant_body *body) {} void rb_yjit_iseq_update_references(const struct rb_iseq_constant_body *body) {} void rb_yjit_iseq_free(const struct rb_iseq_constant_body *body) {} void rb_yjit_before_ractor_spawn(void) {} -void rb_yjit_constant_ic_update(const rb_iseq_t *iseq, IC ic) {} +void rb_yjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic) {} void rb_yjit_tracing_invalidate_all(void) {} #endif // if JIT_ENABLED && PLATFORM_SUPPORTED_P |