Skip to content

Commit 4a4305b

Browse files
committed
chore: clear scratch before run
1 parent a1d3d4a commit 4a4305b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libs/@local/hashql/mir/src/interpret/runtime.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ impl<'ctx, 'heap, A: Allocator + Clone> Runtime<'ctx, 'heap, A> {
573573
&mut self,
574574
mut callstack: CallStack<'ctx, 'heap, A>,
575575
) -> Result<Value<'heap, A>, InterpretDiagnostic> {
576+
self.scratch.clear();
577+
576578
loop {
577579
let result = self.step(&mut callstack);
578580
let next = match result {

libs/@local/hashql/mir/src/interpret/scratch.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ impl<A: Allocator> Scratch<'_, A> {
1818
target_args: Vec::new_in(alloc),
1919
}
2020
}
21+
22+
pub(crate) fn clear(&mut self) {
23+
self.indices.clear();
24+
self.target_args.clear();
25+
}
2126
}

0 commit comments

Comments
 (0)