fix(interpreter): wrong le byte order on pop
This commit is contained in:
@@ -31,7 +31,7 @@ impl Register {
|
||||
|
||||
/// Decrement stack pointer
|
||||
pub fn push(&mut self) -> Result<(), InterpreterError> {
|
||||
if self.sp <= 2 {
|
||||
if self.sp < 2 {
|
||||
return Err(InterpreterError::InvalidRegisterState(*self));
|
||||
} else {
|
||||
self.sp -= 2;
|
||||
@@ -41,7 +41,7 @@ impl Register {
|
||||
|
||||
/// Increment stack pointer
|
||||
pub fn pop(&mut self) -> Result<(), InterpreterError> {
|
||||
if self.sp >= 0xffff - 2 {
|
||||
if self.sp > 0xffff - 2 {
|
||||
return Err(InterpreterError::InvalidRegisterState(*self));
|
||||
} else {
|
||||
self.sp += 2;
|
||||
|
||||
Reference in New Issue
Block a user