Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Replaced unsound `ptr::read` with safe unbox in panic recovery, removing UB from potential double-drop ([#2934](https://github.com/0xMiden/miden-vm/pull/2934)).
- Reverted `InvokeKind::ProcRef` back to `InvokeKind::Exec` in `visit_mut_procref` and added an explanatory comment (#2893).
- Fixed the release dry-run publish cycle between `miden-air` and `miden-ace-codegen`, and preserved leaf-only DAG imports with explicit snapshots ([#2931](https://github.com/0xMiden/miden-vm/pull/2931)).
- Added regression coverage for the exact `max_num_continuations` continuation-stack boundary.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link to this PR, as with the other lines.


#### Changes

Expand Down
27 changes: 27 additions & 0 deletions processor/src/fast/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,33 @@ fn test_continuation_stack_limit_exceeded() {
assert_matches!(err, ExecutionError::Internal(msg) if msg.contains("continuation stack"));
}

/// Tests that a continuation stack size exactly equal to `max_num_continuations` succeeds.
#[test]
fn test_continuation_stack_limit_exactly_max_continuations_succeeds() {
let mut host = DefaultHost::default();

let program = {
let mut forest = MastForest::new();

let leaf_id = BasicBlockNodeBuilder::new(vec![Operation::Noop], Vec::new())
.add_to_forest(&mut forest)
.unwrap();

let root = JoinNodeBuilder::new([leaf_id, leaf_id]).add_to_forest(&mut forest).unwrap();
forest.make_root(root);
Program::new(forest.into(), root)
};

// A single join peaks at three continuations after the join start step:
// FinishJoin(root), StartNode(second), StartNode(first).
let options = ExecutionOptions::default().with_max_num_continuations(3);

let processor =
FastProcessor::new_with_options(StackInputs::default(), AdviceInputs::default(), options);

processor.execute_sync(&program, &mut host).unwrap();
}

// TEST HELPERS
// -----------------------------------------------------------------------------------------------

Expand Down
Loading