pull/72/head
Josselin 6 years ago
parent c08c3b56e7
commit cc64d36486
  1. 3
      slither/core/source_mapping/source_mapping.py
  2. 8
      slither/solc_parsing/declarations/function.py

@ -62,6 +62,9 @@ class SourceMapping(Context):
return {'start':s, 'length':l, 'filename': filename, 'lines' : lines }
def set_offset(self, offset, slither):
if isinstance(offset, dict):
self._source_mapping = offset
else:
self._source_mapping = self._convert_source_mapping(offset, slither)

@ -867,23 +867,23 @@ class FunctionSolc(Function):
def split_ternary_node(self, node, condition, true_expr, false_expr):
condition_node = self._new_node(NodeType.IF, condition['src'])
condition_node = self._new_node(NodeType.IF, node.source_mapping)
condition_node.add_expression(condition)
condition_node.analyze_expressions(self)
true_node = self._new_node(node.type, true_expr['src'])
true_node = self._new_node(node.type, node.source_mapping)
if node.type == NodeType.VARIABLE:
true_node.add_variable_declaration(node.variable_declaration)
true_node.add_expression(true_expr)
true_node.analyze_expressions(self)
false_node = self._new_node(node.type, false_expr['src'])
false_node = self._new_node(node.type, node.source_mapping)
if node.type == NodeType.VARIABLE:
false_node.add_variable_declaration(node.variable_declaration)
false_node.add_expression(false_expr)
false_node.analyze_expressions(self)
endif_node = self._new_node(NodeType.ENDIF, condition['src'])
endif_node = self._new_node(NodeType.ENDIF, node.source_mapping)
for father in node.fathers:
father.remove_son(node)

Loading…
Cancel
Save