pull/7/head
aniket-engg 5 years ago
parent ebae2a19a8
commit 78db7cf793
  1. 4
      remix-analyzer/src/solidity-analyzer/modules/forLoopIteratesOverDynamicArray.js

@ -8,8 +8,8 @@ function forLoopIteratesOverDynamicArray () {
}
forLoopIteratesOverDynamicArray.prototype.visit = function (node) {
if (common.isForLoop(node) &&
(common.isDynamicArrayLengthAccess(node.children[1].children[1]) || // condition uses dynamic array length like `i < array.length`
if (common.isForLoop(node) && // is for loop node
(common.isDynamicArrayLengthAccess(node.children[1].children[1]) || // check if for loop condition uses dynamic array length like `i < array.length`
(node.children[1].children[1].children && common.isDynamicArrayLengthAccess(node.children[1].children[1].children[0]))) // or like `i < array.length (operator like -,+,*,/) number` e.g; i < array.length -1
) {
this.relevantNodes.push(node)

Loading…
Cancel
Save