From 247ea28d2aa32453697f8c62aa58249510d2b44d Mon Sep 17 00:00:00 2001 From: John Adler Date: Mon, 27 Feb 2023 15:49:14 -0500 Subject: [PATCH] Make LDC clobber the stack. (#460) Ref: https://github.com/FuelLabs/fuel-specs/issues/346#issuecomment-1324518174 --- src/vm/instruction_set.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vm/instruction_set.md b/src/vm/instruction_set.md index adf7a29a..e8faec66 100644 --- a/src/vm/instruction_set.md +++ b/src/vm/instruction_set.md @@ -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).