fixes memory write: no padding
This commit is contained in:
parent
fdc34a4cf6
commit
17188dfcb1
|
@ -223,9 +223,10 @@ proc writePaddedResult(mem: var Memory,
|
||||||
mem.extend(memPos, len)
|
mem.extend(memPos, len)
|
||||||
let dataEndPosition = dataPos.int64 + len - 1
|
let dataEndPosition = dataPos.int64 + len - 1
|
||||||
let sourceBytes = data[min(dataPos, data.len) .. min(data.len - 1, dataEndPosition)]
|
let sourceBytes = data[min(dataPos, data.len) .. min(data.len - 1, dataEndPosition)]
|
||||||
|
|
||||||
mem.write(memPos, sourceBytes)
|
mem.write(memPos, sourceBytes)
|
||||||
|
|
||||||
|
# geth doesn't do padding, it causes block validation error
|
||||||
|
when false:
|
||||||
# Don't duplicate zero-padding of mem.extend
|
# Don't duplicate zero-padding of mem.extend
|
||||||
let paddingOffset = memPos + sourceBytes.len
|
let paddingOffset = memPos + sourceBytes.len
|
||||||
# TODO: avoid unnecessary memory allocation
|
# TODO: avoid unnecessary memory allocation
|
||||||
|
|
Loading…
Reference in New Issue