pull/87/head
Josselin 6 years ago
parent abc85f0607
commit ede269cc14
  1. 2
      slither/slithir/utils/ssa.py

@ -129,7 +129,6 @@ def last_name(n, var, init_vars):
if n.type == NodeType.ENTRYPOINT: if n.type == NodeType.ENTRYPOINT:
if var.name in init_vars: if var.name in init_vars:
candidates.append(init_vars[var.name]) candidates.append(init_vars[var.name])
print(n)
assert candidates assert candidates
return max(candidates, key=lambda v: v.index) return max(candidates, key=lambda v: v.index)
@ -287,7 +286,6 @@ def generate_ssa_irs(node, local_variables_instances, all_local_variables_instan
def fix_phi_rvalues_and_storage_ref(node, local_variables_instances, all_local_variables_instances, state_variables_instances, all_state_variables_instances, init_local_variables_instances): def fix_phi_rvalues_and_storage_ref(node, local_variables_instances, all_local_variables_instances, state_variables_instances, all_state_variables_instances, init_local_variables_instances):
for ir in node.irs_ssa: for ir in node.irs_ssa:
print(ir)
if isinstance(ir, (Phi)) and not ir.rvalues: if isinstance(ir, (Phi)) and not ir.rvalues:
variables = [last_name(dst, ir.lvalue, init_local_variables_instances) for dst in ir.nodes] variables = [last_name(dst, ir.lvalue, init_local_variables_instances) for dst in ir.nodes]
ir.rvalues = variables ir.rvalues = variables

Loading…
Cancel
Save