From 3dcbe68aeae9c6892e122988f6d2085d169ee3fb Mon Sep 17 00:00:00 2001 From: NIC619 Date: Fri, 21 Jul 2017 00:25:36 -0400 Subject: [PATCH] minor fix on assembly example --- docs/assembly.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assembly.rst b/docs/assembly.rst index 855f5d721..4e665b7ec 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)))) } } }