Fix off by 1 error in codecopy (#812)
* Fix off by 1 in codecopy * Add regression test * Improve formatting
This commit is contained in:
parent
fb3938bb3e
commit
eaa0e524b4
@ -1660,7 +1660,7 @@ class EVM(Eventful):
|
||||
self._consume(GCOPY * ceil32(size) // 32)
|
||||
|
||||
for i in range(size):
|
||||
if (code_offset + i > len(self.bytecode)):
|
||||
if code_offset + i >= len(self.bytecode):
|
||||
self._store(mem_offset + i, 0)
|
||||
else:
|
||||
self._store(mem_offset + i, Operators.ORD(self.bytecode[code_offset + i]))
|
||||
|
||||
5
tests/binaries/780.sol
Normal file
5
tests/binaries/780.sol
Normal file
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
function C(bool x) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -128,7 +128,7 @@ class IntegrationTest(unittest.TestCase):
|
||||
self.assertTrue(len(actual) > 100 )
|
||||
|
||||
def test_eth_regressions(self):
|
||||
contracts = [676, 678, 701, 714, 735, 760]
|
||||
contracts = [676, 678, 701, 714, 735, 760, 780]
|
||||
for contract in contracts:
|
||||
self._simple_cli_run('{}.sol'.format(contract))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user