summaryrefslogtreecommitdiff
path: root/yjit.h
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-12-06 17:09:52 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-12-06 19:24:41 -0500
commitb7ea66bc3228635a87125bea69f01779f75c39de (patch)
tree3806cf3ddae13c97987ed2c99f8c73db40ab0797 /yjit.h
parent0209beaca6880eba18eaf15591ff7f8d02b0d208 (diff)
downloadruby-b7ea66bc3228635a87125bea69f01779f75c39de.tar.gz
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 <jemmaissroff@gmail.com>
Diffstat (limited to 'yjit.h')
-rw-r--r--yjit.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/yjit.h b/yjit.h
index c254c02cd8..357acdd4b4 100644
--- a/yjit.h
+++ b/yjit.h
@@ -60,7 +60,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 // #ifndef YJIT_H