Skip to content

Commit 3d32add

Browse files
Save final_pc in structure
1 parent f54443c commit 3d32add

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vm/src/vm/runners/cairo_runner_2.rs

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub struct CairoRunner2 {
3030
virtual_machine: VirtualMachine,
3131
program_base: Relocatable,
3232
execution_base: Relocatable,
33+
final_pc: Relocatable,
3334

3435
// Configuration
3536
executable: Executable,
@@ -149,11 +150,17 @@ impl CairoRunner2 {
149150
.validate_existing_memory()
150151
.map_err(RunnerError::MemoryValidationError)?;
151152

153+
let final_pc = match entrypoint_kind {
154+
EntryPointKind::Bootloader => return_pc,
155+
EntryPointKind::Standalone => (initial_pc + 4)?,
156+
};
157+
152158
Ok(Self {
153159
executable,
154160
virtual_machine,
155161
program_base,
156162
execution_base,
163+
final_pc,
157164
entrypoint_kind,
158165
layout,
159166
trace_enabled,

0 commit comments

Comments
 (0)