Skip to content

Commit

Permalink
Clarify that non-zero reserved part of an instruction causes vm panic (
Browse files Browse the repository at this point in the history
…#583)

VM PR: FuelLabs/fuel-vm#737

What is says on the tin. This is a small but breaking change. It's
unlikely to cause any breakage, as no Sway code or code constructed
using the fuel-asm helper functions is affected.

This change is originating from an audit report that pointed out the
likely unintentional behavior of the unused part of instruction is
ignored.

### Before requesting review
- [x] I have reviewed the code myself

Co-authored-by: Green Baneling <[email protected]>
  • Loading branch information
Dentosal and xgreenx authored May 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 525f6a6 commit 7ed5c58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fuel-vm/instruction-set.md
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ This page provides a description of all instructions for the FuelVM. Encoding is

### Panics

Some instructions may _panic_, i.e. enter an unrecoverable state. Additionally, attempting to execute an instruction not in this list causes a panic and consumes no gas. How a panic is handled depends on [context](./index.md#contexts):
Some instructions may _panic_, i.e. enter an unrecoverable state. Additionally, attempting to execute an instruction not in this list causes a panic and consumes no gas. Instructions with unspecified (reserved) part having a non-zero value will likewise panic. How a panic is handled depends on [context](./index.md#contexts):

- In a predicate context, cease VM execution and return `false`.
- In other contexts, revert (described below).

0 comments on commit 7ed5c58

Please sign in to comment.