mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
evmjit: Correctly release result
This commit is contained in:
parent
88d61235e3
commit
bc9a71e7ab
1 changed files with 6 additions and 2 deletions
|
|
@ -80,7 +80,7 @@ import (
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
// "github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/params"
|
"github.com/ethereum/go-ethereum/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -457,6 +457,7 @@ func (evm *EVMJIT) Run(contract *Contract, input []byte) (ret []byte, err error)
|
||||||
msg.input_size = C.size_t(len(input))
|
msg.input_size = C.size_t(len(input))
|
||||||
msg.gas = gas
|
msg.gas = gas
|
||||||
msg.depth = C.int32_t(evm.env.depth - 1)
|
msg.depth = C.int32_t(evm.env.depth - 1)
|
||||||
|
msg.code_hash = HashToEvmc(crypto.Keccak256Hash(code))
|
||||||
|
|
||||||
r := C.evm_execute(evm.jit, &wrapper.c, rev, &msg, codePtr, codeSize)
|
r := C.evm_execute(evm.jit, &wrapper.c, rev, &msg, codePtr, codeSize)
|
||||||
|
|
||||||
|
|
@ -475,6 +476,9 @@ func (evm *EVMJIT) Run(contract *Contract, input []byte) (ret []byte, err error)
|
||||||
err = ErrOutOfGas
|
err = ErrOutOfGas
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.release != nil {
|
||||||
C.evm_release_result(&r)
|
C.evm_release_result(&r)
|
||||||
|
}
|
||||||
|
|
||||||
return output, err
|
return output, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue