mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
clone memory in ScopeContext.MemoryData
This commit is contained in:
parent
b21288d229
commit
c59e9e5e6b
1 changed files with 2 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ package vm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"slices"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
|
|
@ -50,7 +51,7 @@ func (ctx *ScopeContext) MemoryData() []byte {
|
||||||
if ctx.Memory == nil {
|
if ctx.Memory == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return ctx.Memory.Data()
|
return slices.Clone(ctx.Memory.Data())
|
||||||
}
|
}
|
||||||
|
|
||||||
// StackData returns the stack data. Callers must not modify the contents
|
// StackData returns the stack data. Callers must not modify the contents
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue