Skip to content

Commit 48fb0c3

Browse files
committed
core/vm: check for 'no code' before doing any work
1 parent ea2718c commit 48fb0c3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎core/vm/vm.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
7171
}
7272
}
7373

74+
// Don't bother with the execution if there's no code.
75+
if len(code) == 0 {
76+
return context.Return(nil), nil
77+
}
78+
7479
var (
7580
op OpCode
7681
codehash = crypto.Sha3Hash(code)
@@ -94,11 +99,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
9499
}
95100
)
96101

97-
// Don't bother with the execution if there's no code.
98-
if len(code) == 0 {
99-
return context.Return(nil), nil
100-
}
101-
102102
for {
103103
// The base for all big integer arithmetic
104104
base := new(big.Int)

0 commit comments

Comments
 (0)