Skip to content

Commit d42b9b2

Browse files
committed
core/vm: implement codeAddress argument for hostContext.Call sig
See ethereum/evmc@8314761#diff-4c54ef259154e3cd3bd18b1963e027655525f909a887700cc2d1386e075c3628R144-R155 Date: 2022-11-07 12:12:44-08:00 Signed-off-by: meows <[email protected]>
1 parent b2c886b commit d42b9b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/vm/evmc.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,10 @@ func (host *hostContext) EmitLog(addr evmc.Address, evmcTopics []evmc.Hash, data
295295
// Call(kind evmc.CallKind, evmcDestination evmc.Address, evmcSender evmc.Address, valueBytes evmc.Hash, input []byte, gas int64, depth int, static bool, saltBytes evmc.Hash) (output []byte, gasLeft int64, createAddrEvmc evmc.Address, err error)
296296
func (host *hostContext) Call(kind evmc.CallKind,
297297
evmcDestination evmc.Address, evmcSender evmc.Address, valueBytes evmc.Hash, input []byte, gas int64, depth int,
298-
static bool, saltBytes evmc.Hash) (output []byte, gasLeft int64, gasRefund int64, createAddrEvmc evmc.Address, err error) {
298+
static bool, saltBytes evmc.Hash, evmcCodeAddress evmc.Address) (output []byte, gasLeft int64, gasRefund int64, createAddrEvmc evmc.Address, err error) {
299299

300300
destination := common.Address(evmcDestination)
301+
codeTarget := common.Address(evmcCodeAddress)
301302

302303
var createAddr common.Address
303304

@@ -318,9 +319,9 @@ func (host *hostContext) Call(kind evmc.CallKind,
318319
output, gasLeftU, err = host.env.Call(host.contract, destination, input, gasU, value.ToBig())
319320
}
320321
case evmc.DelegateCall:
321-
output, gasLeftU, err = host.env.DelegateCall(host.contract, destination, input, gasU)
322+
output, gasLeftU, err = host.env.DelegateCall(host.contract, codeTarget, input, gasU)
322323
case evmc.CallCode:
323-
output, gasLeftU, err = host.env.CallCode(host.contract, destination, input, gasU, value.ToBig())
324+
output, gasLeftU, err = host.env.CallCode(host.contract, codeTarget, input, gasU, value.ToBig())
324325
case evmc.Create:
325326
var createOutput []byte
326327
createOutput, createAddr, gasLeftU, err = host.env.Create(host.contract, input, gasU, value.ToBig())

0 commit comments

Comments
 (0)