Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ public static EvmExceptionType InstructionCall<TOpCall, TTracingInst>(
Address codeSource = stack.PopAddress();
if (codeSource is null) goto StackUnderflow;

// Charge gas for accessing the account's code (including delegation logic if applicable).
if (!EvmCalculations.ChargeAccountAccessGasWithDelegation(ref gasAvailable, vm, codeSource)) goto OutOfGas;

ref readonly ExecutionEnvironment env = ref vm.EvmState.Env;
// Determine the call value based on the call type.
UInt256 callValue;
Expand All @@ -130,6 +127,16 @@ public static EvmExceptionType InstructionCall<TOpCall, TTracingInst>(
goto StackUnderflow;
}

// Pop additional parameters: data offset, data length, output offset, and output length.
if (!stack.PopUInt256(out UInt256 dataOffset) ||
!stack.PopUInt256(out UInt256 dataLength) ||
!stack.PopUInt256(out UInt256 outputOffset) ||
!stack.PopUInt256(out UInt256 outputLength))
goto StackUnderflow;

// Charge gas for accessing the account's code (including delegation logic if applicable).
if (!EvmCalculations.ChargeAccountAccessGasWithDelegation(ref gasAvailable, vm, codeSource)) goto OutOfGas;

// For non-delegate calls, the transfer value is the call value.
UInt256 transferValue = typeof(TOpCall) == typeof(OpDelegateCall) ? UInt256.Zero : callValue;
// Enforce static call restrictions: no value transfer allowed unless it's a CALLCODE.
Expand Down Expand Up @@ -162,13 +169,6 @@ public static EvmExceptionType InstructionCall<TOpCall, TTracingInst>(
gasExtra += GasCostOf.NewAccount;
}

// Pop additional parameters: data offset, data length, output offset, and output length.
if (!stack.PopUInt256(out UInt256 dataOffset) ||
!stack.PopUInt256(out UInt256 dataLength) ||
!stack.PopUInt256(out UInt256 outputOffset) ||
!stack.PopUInt256(out UInt256 outputLength))
goto StackUnderflow;

// Update gas: call cost, memory expansion for input and output, and extra gas.
if (!EvmCalculations.UpdateGas(spec.GetCallCost(), ref gasAvailable) ||
!EvmCalculations.UpdateMemoryCost(vm.EvmState, ref gasAvailable, in dataOffset, dataLength) ||
Expand Down
Loading