Skip to content

Commit f7d80fc

Browse files
committed
instructions: only add JUMP(I) targets if we are not deploying a contract
Signed-off-by: Ignacio Hagopian <[email protected]>
1 parent 9b476e9 commit f7d80fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/vm/instructions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ func opJump(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt
584584
return nil, errStopToken
585585
}
586586
pos := scope.Stack.pop()
587-
if interpreter.evm.chainRules.IsEIP4762 {
587+
if interpreter.evm.chainRules.IsEIP4762 && !scope.Contract.IsDeployment {
588588
statelessGas, wanted := interpreter.evm.TxContext.Accesses.TouchCodeChunksRangeAndChargeGas(scope.Contract.CodeAddr[:], pos.Uint64(), 1, uint64(len(scope.Contract.Code)), false, scope.Contract.Gas)
589589
scope.Contract.UseGas(statelessGas)
590590
if statelessGas < wanted {
@@ -604,7 +604,7 @@ func opJumpi(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
604604
}
605605
pos, cond := scope.Stack.pop(), scope.Stack.pop()
606606
if !cond.IsZero() {
607-
if interpreter.evm.chainRules.IsEIP4762 {
607+
if interpreter.evm.chainRules.IsEIP4762 && !scope.Contract.IsDeployment {
608608
statelessGas, wanted := interpreter.evm.TxContext.Accesses.TouchCodeChunksRangeAndChargeGas(scope.Contract.CodeAddr[:], pos.Uint64(), 1, uint64(len(scope.Contract.Code)), false, scope.Contract.Gas)
609609
scope.Contract.UseGas(statelessGas)
610610
if statelessGas < wanted {

0 commit comments

Comments
 (0)