mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-07 00:03:10 +00:00
Feedback
This commit is contained in:
parent
aaf7ace396
commit
9b259cb917
@ -10,7 +10,6 @@
|
||||
/// Note that this correctly handles exp(0, 0) == 1.
|
||||
|
||||
global exp:
|
||||
jumpdest
|
||||
// stack: x, e, retdest
|
||||
dup2
|
||||
// stack: e, x, e, retdest
|
||||
@ -27,7 +26,6 @@ global exp:
|
||||
jump
|
||||
|
||||
step_case:
|
||||
jumpdest
|
||||
// stack: x, e, retdest
|
||||
push recursion_return
|
||||
// stack: recursion_return, x, e, retdest
|
||||
@ -43,7 +41,6 @@ step_case:
|
||||
// stack: x * x, e / 2, recursion_return, x, e, retdest
|
||||
%jump(exp)
|
||||
recursion_return:
|
||||
jumpdest
|
||||
// stack: exp(x * x, e / 2), x, e, retdest
|
||||
push 2
|
||||
// stack: 2, exp(x * x, e / 2), x, e, retdest
|
||||
|
||||
@ -250,7 +250,7 @@ impl<'a> Interpreter<'a> {
|
||||
0x58 => todo!(), // "GETPC",
|
||||
0x59 => todo!(), // "MSIZE",
|
||||
0x5a => todo!(), // "GAS",
|
||||
0x5b => (), // "JUMPDEST",
|
||||
0x5b => self.run_jumpdest(), // "JUMPDEST",
|
||||
0x5c => todo!(), // "GET_STATE_ROOT",
|
||||
0x5d => todo!(), // "SET_STATE_ROOT",
|
||||
0x5e => todo!(), // "GET_RECEIPT_ROOT",
|
||||
@ -490,6 +490,10 @@ impl<'a> Interpreter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn run_jumpdest(&mut self) {
|
||||
assert!(!self.kernel_mode, "JUMPDEST is not needed in kernel code");
|
||||
}
|
||||
|
||||
fn jump_to(&mut self, offset: usize) {
|
||||
// The JUMPDEST rule is not enforced in kernel mode.
|
||||
if !self.kernel_mode && self.jumpdests.binary_search(&offset).is_err() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user