diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2025-09-25 17:45:35 -0400 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2025-09-25 18:36:58 -0400 |
| commit | 6ea7557353982bb4b5de2dcd836233f328dc00f6 (patch) | |
| tree | c8d84d327b025b62942cd2c43602e699dfb770d7 | |
| parent | adfa784eaa03a215f2d57ce7e219cc7504ecc68b (diff) | |
ZJIT: Reference update `Invariant::cme_patch_points`
| -rw-r--r-- | zjit/src/invariants.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/zjit/src/invariants.rs b/zjit/src/invariants.rs index cea97bc8ee..473eec9e95 100644 --- a/zjit/src/invariants.rs +++ b/zjit/src/invariants.rs @@ -66,6 +66,7 @@ impl Invariants { pub fn update_references(&mut self) { self.update_ep_escape_iseqs(); self.update_no_ep_escape_iseq_patch_points(); + self.update_cme_patch_points(); } /// Forget an ISEQ when freeing it. We need to because a) if the address is reused, we'd be @@ -99,6 +100,17 @@ impl Invariants { .collect(); self.no_ep_escape_iseq_patch_points = updated; } + + fn update_cme_patch_points(&mut self) { + let updated_cme_patch_points = std::mem::take(&mut self.cme_patch_points) + .into_iter() + .map(|(cme, patch_points)| { + let new_cme = unsafe { rb_gc_location(cme.into()) }; + (new_cme.as_cme(), patch_points) + }) + .collect(); + self.cme_patch_points = updated_cme_patch_points; + } } /// Called when a basic operator is redefined. Note that all the blocks assuming |
