Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
internal_call_stack_manager.cpp
Go to the documentation of this file.
2
3namespace bb::avm2::simulation {
4
6{
7 // Add the current call id & return_pc to the stack
8 internal_call_stack.push({ .return_id = current_return_call_id, .return_pc = return_pc });
9
12 .entered_call_id = next_internal_call_id,
14 .return_id = current_return_call_id,
15 .return_pc = return_pc,
16 });
17
18 // Update id values
22}
23
25{
26 if (internal_call_stack.empty()) {
27 throw std::runtime_error("Internal call stack is empty. Cannot pop.");
28 }
29 // We need to restore the call ptr info to the previous call
30 InternalCallPtr prev_call_ptr = internal_call_stack.top();
31
32 // Reset the id values
34 current_return_call_id = prev_call_ptr.return_id;
35
37
38 // Return the next pc of the previous call
39 return prev_call_ptr.return_pc;
40}
41
46
51
56
57} // namespace bb::avm2::simulation
EventEmitterInterface< InternalCallStackEvent > & internal_call_stack_events
uint32_t PC
uint32_t InternalCallId