Skip to content

Commit

Permalink
Fix invalid return value when closing an iterator (#3567)
Browse files Browse the repository at this point in the history
  • Loading branch information
raskad authored Jan 5, 2024
1 parent 0cb17cf commit 6c5dfe0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/engine/src/vm/opcode/iteration/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,12 @@ impl Operation for IteratorReturn {
return Ok(CompletionType::Normal);
};

let return_value = context.vm.get_return_value();

let value = ret.call(&record.iterator().clone().into(), &[], context)?;

context.vm.set_return_value(return_value);

context.vm.push(value);
context.vm.push(true);

Expand Down

0 comments on commit 6c5dfe0

Please sign in to comment.