pub enum Effect {
AssertionFailed,
DivisionByZero,
IntegerOverflow,
InvalidAddress,
InvalidReference,
InvalidStackIndex,
OutOfOperators,
StackUnderflow,
UnknownIdentifier,
Yield,
}Expand description
Variants§
AssertionFailed
§An assertion failed
Can trigger when evaluating assert, if its input is zero.
DivisionByZero
§Tried to divide by zero
Can trigger when evaluating the / operator, if its second input is
0.
IntegerOverflow
§Division resulted in integer overflow
Can only trigger when evaluating the / operator, if its first input is
the lowest signed (two’s complement) 32-bit integer, and its second
input is -1.
All other arithmetic operators wrap on overflow and don’t trigger this effect.
InvalidAddress
§A memory address is out of bounds
Can trigger when evaluating the read or write operators, if their
address input (when interpreted as an unsigned 32-bit integer) does
not refer to an address that is within the bounds of the memory.
InvalidReference
§Evaluated a reference that is not paired with a matching label
Can trigger when evaluating a reference, if that reference does not refer to a label.
InvalidStackIndex
§An index that supposedly refers to a value on the stack, doesn’t
Can trigger when evaluating the copy or drop operators, if their
index input is too large to refer to a value on the stack.
OutOfOperators
§Ran out of operators to evaluate
Triggers when evaluation reaches the end of the script, where no more operators are available. This signals the regular end of the evaluation.
StackUnderflow
§Tried popping a value from an empty stack
Can trigger when evaluating any operator that has more inputs than the number of values currently on the stack.
UnknownIdentifier
§Evaluated an identifier that the language does not recognize
Can trigger when evaluating an identifier, if that identifier does not refer to a known operation.
Yield
§The evaluating script yields control to the host
Triggers when evaluating the yield operator.