Skip to content

Commit

Permalink
Do not restore $hp when returning from a context (#506)
Browse files Browse the repository at this point in the history
Causes this issue FuelLabs/sway#4828
  • Loading branch information
Dentosal authored Jul 26, 2023
1 parent e29fcd9 commit c7b9da6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fuel-vm/instruction-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ Set the return value:
1. `$ret = $rA`
1. `$retl = 0`

Then pop the call frame and restoring registers _except_ `$ggas`, `$cgas`, `$ret`, and `$retl`. Afterwards, set the following registers:
Then pop the call frame and restore all registers _except_ `$ggas`, `$cgas`, `$ret`, `$retl` and `$hp`. Afterwards, set the following registers:

1. `$pc = $pc + 4` (advance program counter from where we called)

Expand Down Expand Up @@ -1932,7 +1932,7 @@ Set the return value:
1. `$ret = $rA`
1. `$retl = $rB`

Then pop the call frame and restoring registers _except_ `$ggas`, `$cgas`, `$ret`, and `$retl`. Afterwards, set the following registers:
Then pop the call frame and restore all registers _except_ `$ggas`, `$cgas`, `$ret`, `$retl` and `$hp`. Afterwards, set the following registers:

1. `$pc = $pc + 4` (advance program counter from where we called)

Expand Down

0 comments on commit c7b9da6

Please sign in to comment.