pub enum InvalidBytecode {
StackUnderflow,
InvalidInstruction,
InvalidBuiltin,
InvalidStringId,
MalformedHeader,
ProgramOutOfBounds,
StackOutOfBounds,
Utf8Error(Utf8Error),
}Expand description
Errors that may only be caused due to invalid bytecode.
If this error is returned by an espy program compiled by a compatible version of the compiler, it is considered an espy bug.
Variants§
StackUnderflow
Caused by an imbalance in stack operations.
Well-behaved bytecode never has any reason to cause this.
InvalidInstruction
An instruction byte had an unexpected value.
InvalidBuiltin
A clone referred to a builtin value that does not exist.
InvalidStringId
An instruction referred to a string id that did not exist.
MalformedHeader
Occurs when the header is too short or describes a program which is longer than the provided slice.
ProgramOutOfBounds
Occurs when the program counter becomes greater than the length of the program.
Note the “greater”; a pc of the program’s length (after the last byte) is considered an intentional return.
StackOutOfBounds
Occurs when a stack access goes beyond the length of the stack.