From 425d2c6a433060c06f651bba21b31f269f8422a8 Mon Sep 17 00:00:00 2001 From: Kevin Clancy Date: Wed, 31 May 2023 10:07:30 -0700 Subject: [PATCH] keep padding in assignments generated from declarations --- slither/solc_parsing/declarations/function.py | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/slither/solc_parsing/declarations/function.py b/slither/solc_parsing/declarations/function.py index 433fb6ed3c..bf3f1507c8 100644 --- a/slither/solc_parsing/declarations/function.py +++ b/slither/solc_parsing/declarations/function.py @@ -929,19 +929,24 @@ def _parse_variable_definition(self, statement: Dict, node: NodeSolc) -> NodeSol new_node = self._parse_variable_definition_init_tuple( new_statement, i, new_node ) + else: + variables.append(None) i = i + 1 var_identifiers = [] # craft of the expression doing the assignement for v in variables: - identifier = { - "nodeType": "Identifier", - "referencedDeclaration": v["id"], - "src": v["src"], - "name": v["name"], - "typeDescriptions": {"typeString": v["typeDescriptions"]["typeString"]}, - } - var_identifiers.append(identifier) + if v != None: + identifier = { + "nodeType": "Identifier", + "referencedDeclaration": v["id"], + "src": v["src"], + "name": v["name"], + "typeDescriptions": {"typeString": v["typeDescriptions"]["typeString"]}, + } + var_identifiers.append(identifier) + else: + var_identifiers.append(None) tuple_expression = { "nodeType": "TupleExpression",