diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2024-01-24 18:06:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 18:06:58 -0500 |
commit | 2cc7a56ec7830fd5efaf2bc449637fd831743714 (patch) | |
tree | c7cdc48f52a5ac0c4fb2dbd69e4af218e4a3473c /yjit/bindgen/src/main.rs | |
parent | f769d68a69f0a8c84e46e43179bda6332923fb11 (diff) | |
download | ruby-2cc7a56ec7830fd5efaf2bc449637fd831743714.tar.gz |
YJIT: Avoid leaks by skipping objects with a singleton class
For receiver with a singleton class, there are multiple vectors YJIT can
end up retaining the object. There is a path in jit_guard_known_klass()
that bakes the receiver into the code, and the object could also be kept
alive indirectly through a path starting at the CME object baked into
the code.
To avoid these leaks, avoid compiling calls on objects with a singleton
class.
See: https://github.com/Shopify/ruby/issues/552
[Bug #20209]
Diffstat (limited to 'yjit/bindgen/src/main.rs')
-rw-r--r-- | yjit/bindgen/src/main.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs index 742885de3b..45874f28a1 100644 --- a/yjit/bindgen/src/main.rs +++ b/yjit/bindgen/src/main.rs @@ -447,6 +447,7 @@ fn main() { .allowlist_function("rb_obj_is_proc") .allowlist_function("rb_vm_base_ptr") .allowlist_function("rb_ec_stack_check") + .allowlist_function("rb_vm_top_self") // We define VALUE manually, don't import it .blocklist_type("VALUE") |