Skip to content

Commit

Permalink
Merge pull request #87 from multiversx/merge-rc/v1.6.0-in-rc/v1.7.0-2…
Browse files Browse the repository at this point in the history
…3nov

Merge rc/v1.6.0 in rc/v1.7.0 23nov
  • Loading branch information
BeniaminDrasovean authored Nov 24, 2023
2 parents 950d90c + 2b81df5 commit aaff4de
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/gin-gonic/gin v1.9.1
github.com/mitchellh/mapstructure v1.5.0
github.com/multiversx/mx-chain-core-go v1.2.17
github.com/multiversx/mx-chain-core-go v1.2.19-0.20231123115253-158315dc4238
github.com/multiversx/mx-chain-crypto-go v1.2.8
github.com/multiversx/mx-chain-logger-go v1.0.13
github.com/multiversx/mx-chain-vm-common-go v1.5.6
github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231123115741-c8a4816c447a
github.com/multiversx/mx-components-big-int v1.0.0
github.com/pelletier/go-toml v1.9.3
github.com/stretchr/testify v1.8.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/multiversx/mx-chain-core-go v1.2.17 h1:/7YEuowxnpOtZLAJbuibNWE/8rDcG+WMhNVvrnljPg0=
github.com/multiversx/mx-chain-core-go v1.2.17/go.mod h1:BILOGHUOIG5dNNX8cgkzCNfDaVtoYrJRYcPnpxRMH84=
github.com/multiversx/mx-chain-core-go v1.2.19-0.20231123115253-158315dc4238 h1:nlDelmQou2635GW2YACZMAHTc+cRxBvtHE0dRQuVC0U=
github.com/multiversx/mx-chain-core-go v1.2.19-0.20231123115253-158315dc4238/go.mod h1:BILOGHUOIG5dNNX8cgkzCNfDaVtoYrJRYcPnpxRMH84=
github.com/multiversx/mx-chain-crypto-go v1.2.8 h1:wOgVlUaO5X4L8iEbFjcQcL8SZvv6WZ7LqH73BiRPhxU=
github.com/multiversx/mx-chain-crypto-go v1.2.8/go.mod h1:fkaWKp1rbQN9wPKya5jeoRyC+c/SyN/NfggreyeBw+8=
github.com/multiversx/mx-chain-logger-go v1.0.13 h1:eru/TETo0MkO4ZTnXsQDKf4PBRpAXmqjT02klNT/JnY=
github.com/multiversx/mx-chain-logger-go v1.0.13/go.mod h1:MZJhTAtZTJxT+yK2EHc4ZW3YOHUc1UdjCD0iahRNBZk=
github.com/multiversx/mx-chain-vm-common-go v1.5.6 h1:hAWCIkFc5vcweBzpataVsJf0PCPc7tfQBGW/q8nzQ8A=
github.com/multiversx/mx-chain-vm-common-go v1.5.6/go.mod h1:S8bbBlbOVKgl8YBnlmmHakYiSXjKPcSd6WW+Nku/Xys=
github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231123115741-c8a4816c447a h1:LYEKM1wKOiT3SKqYIJEUDVZEV7VM5ISVjXkg1Jbxsk0=
github.com/multiversx/mx-chain-vm-common-go v1.5.9-0.20231123115741-c8a4816c447a/go.mod h1:Uu29N9DDx6iWDrDVPRUiLosrzlbNsYgpNfyhOQztEfE=
github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8=
github.com/multiversx/mx-components-big-int v1.0.0/go.mod h1:maIEMgHlNE2u78JaDD0oLzri+ShgU4okHfzP3LWGdQM=
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
Expand Down
5 changes: 4 additions & 1 deletion vmhost/contexts/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,13 @@ func (context *runtimeContext) MemLoad(offset int32, length int32) ([]byte, erro
return nil, fmt.Errorf("mem load: %w", vmhost.ErrNegativeLength)
}

result := make([]byte, length)
var result []byte

if isRequestedEndTooLarge {
result = make([]byte, memoryLength-uint32(offset))
copy(result, memoryView[offset:])
} else {
result = make([]byte, requestedEnd-offset)
copy(result, memoryView[offset:requestedEnd])
}

Expand Down
2 changes: 1 addition & 1 deletion vmhost/contexts/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ func TestRuntimeContext_MemLoadCases(t *testing.T) {
length = 9
memContents, err = runtimeContext.MemLoad(offset, length)
require.Nil(t, err)
require.Equal(t, []byte{'e', 's', 't', ' ', 'd', 'a', 't', 'a', 0}, memContents)
require.Equal(t, []byte{'e', 's', 't', ' ', 'd', 'a', 't', 'a'}, memContents)

// Zero length
offset = int32(memory.Length() - 8)
Expand Down

0 comments on commit aaff4de

Please sign in to comment.