... | ... | @@ -18,10 +18,11 @@ memory\_chunk 是 auxiliary 中的一个变量,保存了当前 opcode 执 |
|
|
因为 call 同时对memory进行两次 access,所以需要两次 memory\_expansion,上下文转换和 stack\_pointer 类似,不赘述。
|
|
|
|
|
|
需要注意的是 memory\_chunk 在call\_4 才计算完 memory\_expansion 。所以在 current\_state 这里跳过前几步的 memory\_chunk 更新。
|
|
|
|
|
|
```rust
|
|
|
let memory_chunk = match self {
|
|
|
ExecutionState::CALL_1 | ExecutionState::CALL_2 | ExecutionState::CALL_3 => {
|
|
|
current_state.memory_chunk_prev
|
|
|
}
|
|
|
_ => current_state.memory_chunk,
|
|
|
}; |
|
|
\ No newline at end of file |
|
|
};
|
|
|
``` |
|
|
\ No newline at end of file |