Skip to content

Commit 2bebf2b

Browse files
committed
bugfix: infinite loop in
1 parent fd3fb02 commit 2bebf2b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/payload/ext/checkpoint.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,10 @@ impl<P: Platform> CheckpointExt<P> for Checkpoint<P> {
286286
/// by `Checkpoint::new_at_block`.
287287
fn building_since(&self) -> Instant {
288288
let mut created_at = self.created_at();
289-
while let Some(prev) = self.prev() {
289+
let mut current = self.clone();
290+
while let Some(prev) = current.prev() {
290291
created_at = prev.created_at();
292+
current = prev;
291293
}
292294
created_at
293295
}

src/pipelines/exec/scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ impl<P: Platform> RootScope<P> {
107107
) {
108108
let next = scope_of(next_step);
109109
let prev = self.current.replace(next.clone());
110-
let mut root = self.root.write();
111110

112111
if prev != next {
113112
// Scope changed. We will need to leave all scopes from `prev`
114113
// up to the common ancestor, then enter all scopes from the
115114
// common ancestor to `next`.
116115
let common = prev.common_ancestor(&next);
116+
let mut root = self.root.write();
117117

118118
for s in prev.between(&common) {
119119
root.get_mut(&s).expect("scope should exist").leave();

0 commit comments

Comments
 (0)