Skip to content

Commit

Permalink
core/vm: fix error in memory calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Mar 7, 2019
1 parent e17df3e commit 1f5c28d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/vm/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
func calcMemSize64(off, l *big.Int) (uint64, bool) {
// if length is zero, memsize is always zero, regardless of offset
if l.Sign() == 0 {
return 0, true
return 0, false
}
// Check that neither offset nor length overflows
if off.BitLen() > 64 || l.BitLen() > 64 {
Expand All @@ -51,7 +51,7 @@ func calcMemSize64(off, l *big.Int) (uint64, bool) {
func calcMemSize64WithUint(off *big.Int, length64 uint64) (uint64, bool) {
// if length is zero, memsize is always zero, regardless of offset
if length64 == 0 {
return 0, true
return 0, false
}
// Check that offset doesn't overflow
if off.BitLen() > 64 {
Expand Down

0 comments on commit 1f5c28d

Please sign in to comment.