Skip to content

Commit

Permalink
Make LDC clobber the stack. (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
adlerjohn authored Feb 27, 2023
1 parent e74dd91 commit 247ea28
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/vm/instruction_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -1223,13 +1223,12 @@ Panic if:
- `$rA + 32` overflows
- `$ssp + $rC > VM_MAX_RAM`
- `$rA + 32 > VM_MAX_RAM`
- `$ssp != $sp`
- `$ssp + $rC > $hp`
- `$rC > CONTRACT_MAX_SIZE`
- `$rC > MEM_MAX_ACCESS_SIZE`
- Contract with ID `MEM[$rA, 32]` is not in `tx.inputs`

Increment `$fp->codesize`, `$ssp`, and `$sp` by `$rC` padded to word alignment.
Increment `$fp->codesize`, `$ssp` by `$rC` padded to word alignment. Then set `$sp` to `$ssp`.

This instruction can be used to concatenate the code of multiple contracts together. It can only be used when the stack area of the call frame is unused (i.e. prior to being used).

Expand Down

0 comments on commit 247ea28

Please # to comment.