|
|
|
@ -517,6 +517,15 @@ function isDynamicArrayAccess (node) { |
|
|
|
|
return node && nodeType(node, exactMatch(nodeTypes.IDENTIFIER)) && (node.attributes.type.endsWith('[] storage ref') || node.attributes.type === 'bytes storage ref' || node.attributes.type === 'string storage ref') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* True if node accesses 'length' member of array |
|
|
|
|
* @node {ASTNode} node to check for |
|
|
|
|
* @return {bool} |
|
|
|
|
*/ |
|
|
|
|
function isDynamicArrayLengthAccess (node) { |
|
|
|
|
return node && nodeType(node, exactMatch(nodeTypes.MEMBERACCESS)) && (node.attributes.member_name === 'length') && node.children[0].attributes.type.indexOf('[]') !== -1 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* True if node is a delete instruction for an element from a dynamic array |
|
|
|
|
* @node {ASTNode} node to check for |
|
|
|
@ -1111,6 +1120,7 @@ module.exports = { |
|
|
|
|
isAbiNamespaceCall: isAbiNamespaceCall, |
|
|
|
|
isSpecialVariableAccess: isSpecialVariableAccess, |
|
|
|
|
isDynamicArrayAccess: isDynamicArrayAccess, |
|
|
|
|
isDynamicArrayLengthAccess: isDynamicArrayLengthAccess, |
|
|
|
|
isIndexAccess: isIndexAccess, |
|
|
|
|
isMappingIndexAccess: isMappingIndexAccess, |
|
|
|
|
isSubScopeWithTopLevelUnAssignedBinOp: isSubScopeWithTopLevelUnAssignedBinOp, |
|
|
|
|