pull/5370/head
aniket-engg 5 years ago
parent 12baa57e2b
commit 8465a439d5
  1. 4
      remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.4.24.js
  2. 4
      remix-analyzer/test/analysis/staticAnalysisIntegration-test-0.5.0.js
  3. 8
      remix-analyzer/test/analysis/test-contracts/solidity-v0.4.24/forLoopIteratesOverDynamicArray.sol
  4. 8
      remix-analyzer/test/analysis/test-contracts/solidity-v0.5/forLoopIteratesOverDynamicArray.sol

@ -274,7 +274,7 @@ test('Integration test gasCosts.js', function (t) {
'ERC20.sol': 2,
'stringBytesLength.sol': 1,
'etherTransferInLoop.sol': 3,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}
runModuleOnFiles(module, t, (file, report) => {
@ -898,7 +898,7 @@ test('Integration test forLoopIteratesOverDynamicArray.js', function (t) {
'ERC20.sol': 0,
'stringBytesLength.sol': 0,
'etherTransferInLoop.sol': 0,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}
runModuleOnFiles(module, t, (file, report) => {

@ -274,7 +274,7 @@ test('Integration test gasCosts.js', function (t) {
'ERC20.sol': 2,
'stringBytesLength.sol': 1,
'etherTransferInLoop.sol': 3,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}
runModuleOnFiles(module, t, (file, report) => {
@ -902,7 +902,7 @@ test('Integration test forLoopIteratesOverDynamicArray.js', function (t) {
'ERC20.sol': 0,
'stringBytesLength.sol': 0,
'etherTransferInLoop.sol': 0,
'forLoopIteratesOverDynamicArray.sol': 1
'forLoopIteratesOverDynamicArray.sol': 2
}
runModuleOnFiles(module, t, (file, report) => {

@ -6,10 +6,16 @@ contract forLoopArr {
}
function shiftArrItem(uint index) returns(uint[]) {
// TODO: for (uint i = index; i < array.length-1; i++) should also generate warning
for (uint i = index; i < array.length; i++) {
array[i] = array[i+1];
}
return array;
}
function shiftArrItem2(uint index) returns(uint[]) {
for (uint i = index; i < array.length - 1; i++) {
array[i] = array[i+1];
}
return array;
}
}

@ -6,10 +6,16 @@ contract forLoopArr {
}
function shiftArrItem(uint index) public returns(uint[] memory) {
// TODO: for (uint i = index; i < array.length-1; i++) should also generate warning
for (uint i = index; i < array.length; i++) {
array[i] = array[i+1];
}
return array;
}
function shiftArrItem2(uint index) public returns(uint[] memory) {
for (uint i = index; i < array.length - 1; i++) {
array[i] = array[i+1];
}
return array;
}
}

Loading…
Cancel
Save