Skip to content

Commit a90b936

Browse files
committed
fix when CALL should OOG before executing
1 parent 49f6301 commit a90b936

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/opFns.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,12 @@ module.exports = {
546546
options.gasLimit.iadd(new BN(fees.callStipend.v))
547547
}
548548

549-
checkCallMemCost(runState, options, localOpts)
550-
551549
stateManager.exists(toAddress, function (err, exists) {
552550
if (err) {
553551
done(err)
554552
return
555553
}
554+
556555
if (!exists) {
557556
try {
558557
subGas(runState, new BN(fees.callNewAccountGas.v))
@@ -561,6 +560,14 @@ module.exports = {
561560
return
562561
}
563562
}
563+
564+
try {
565+
checkCallMemCost(runState, options, localOpts)
566+
} catch (e) {
567+
done(e.error)
568+
return
569+
}
570+
564571
makeCall(runState, options, localOpts, done)
565572
})
566573
},

0 commit comments

Comments
 (0)