mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixes for failing tests
This commit is contained in:
+2
-2
@@ -91,7 +91,7 @@ you really know what you are doing.
|
||||
// We know that we only access the array in bounds, so we can avoid the check.
|
||||
// 0x20 needs to be added to an array because the first slot contains the
|
||||
// array length.
|
||||
function sumAsm(uint[] _data) returns (uint o_sum) public {
|
||||
function sumAsm(uint[] _data) public returns (uint o_sum) {
|
||||
for (uint i = 0; i < _data.length; ++i) {
|
||||
assembly {
|
||||
o_sum := add(o_sum, mload(add(add(_data, 0x20), mul(i, 0x20))))
|
||||
@@ -100,7 +100,7 @@ you really know what you are doing.
|
||||
}
|
||||
|
||||
// Same as above, but accomplish the entire code within inline assembly.
|
||||
function sumPureAsm(uint[] _data) returns (uint o_sum) public {
|
||||
function sumPureAsm(uint[] _data) public returns (uint o_sum) {
|
||||
assembly {
|
||||
// Load the length (first 32 bytes)
|
||||
let len := mload(_data)
|
||||
|
||||
Reference in New Issue
Block a user