diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 6e7d28a0ce..3bc38d9ade 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -18,6 +18,7 @@ package vm import ( "fmt" + "slices" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" @@ -50,7 +51,7 @@ func (ctx *ScopeContext) MemoryData() []byte { if ctx.Memory == nil { return nil } - return ctx.Memory.Data() + return slices.Clone(ctx.Memory.Data()) } // StackData returns the stack data. Callers must not modify the contents