From 3dcbe68aeae9c6892e122988f6d2085d169ee3fb Mon Sep 17 00:00:00 2001 From: NIC619 Date: Fri, 21 Jul 2017 00:25:36 -0400 Subject: minor fix on assembly example --- docs/assembly.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/assembly.rst b/docs/assembly.rst index 855f5d72..4e665b7e 100644 --- a/docs/assembly.rst +++ b/docs/assembly.rst @@ -92,7 +92,7 @@ you really know what you are doing. function sumAsm(uint[] _data) returns (uint o_sum) { for (uint i = 0; i < _data.length; ++i) { assembly { - o_sum := mload(add(add(_data, 0x20), mul(i, 0x20))) + o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20)))) } } } -- cgit