From 25e5ac48af02e56f5a25795b15913423638234b9 Mon Sep 17 00:00:00 2001 From: Johannes Hostert Date: Mon, 26 Aug 2024 22:46:14 +0200 Subject: [PATCH] Disable tree traversal optimization that is wrong due to lazy nodes. See #3846 for more information. --- src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs index d51e1109ed4..5fbb7b92776 100644 --- a/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs +++ b/src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs @@ -150,7 +150,10 @@ fn perform_access( // the propagation can be skipped next time. // It is a performance loss not to call this function when a foreign access occurs. // It is unsound not to call this function when a child access occurs. - fn skip_if_known_noop( + // FIXME: This optimization is wrong, and is currently disabled (by ignoring the + // result returned here). Since we presumably want an optimization like this, + // we should add it back. See #3864 for more information. + fn update_last_foreign_access( &mut self, access_kind: AccessKind, rel_pos: AccessRelatedness, @@ -613,10 +616,7 @@ pub fn perform_access( let old_state = perm.or_insert(LocationState::new_uninit(node.default_initial_perm)); - match old_state.skip_if_known_noop(access_kind, rel_pos) { - ContinueTraversal::SkipChildren => return Ok(ContinueTraversal::SkipChildren), - _ => {} - } + old_state.update_last_foreign_access(access_kind, rel_pos); let protected = global.borrow().protected_tags.contains_key(&node.tag); let transition = old_state.perform_access(access_kind, rel_pos, protected)?;