(gt configs.GasTable, evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64)
| 346 | } |
| 347 | |
| 348 | func gasCallCode(gt configs.GasTable, evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) { |
| 349 | gas := gt.Calls |
| 350 | if stack.Back(2).Sign() != 0 { |
| 351 | gas += configs.CallValueTransferGas |
| 352 | } |
| 353 | memoryGas, err := memoryGasCost(mem, memorySize) |
| 354 | if err != nil { |
| 355 | return 0, err |
| 356 | } |
| 357 | var overflow bool |
| 358 | if gas, overflow = math.SafeAdd(gas, memoryGas); overflow { |
| 359 | return 0, errGasUintOverflow |
| 360 | } |
| 361 | |
| 362 | evm.callGasTemp, err = callGas(gt, contract.Gas, gas, stack.Back(0)) |
| 363 | if err != nil { |
| 364 | return 0, err |
| 365 | } |
| 366 | if gas, overflow = math.SafeAdd(gas, evm.callGasTemp); overflow { |
| 367 | return 0, errGasUintOverflow |
| 368 | } |
| 369 | return gas, nil |
| 370 | } |
| 371 | |
| 372 | func gasReturn(gt configs.GasTable, evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) { |
| 373 | return memoryGasCost(mem, memorySize) |
nothing calls this directly
no test coverage detected