Improve read info (1cdc34ec77)

pull/169/head
Josselin 6 years ago
parent 29862ea541
commit 8ee0099165
  1. 11
      slither/core/cfg/node.py

@ -575,11 +575,12 @@ class Node(SourceMapping, ChildFunction):
if isinstance(var, (ReferenceVariable)): if isinstance(var, (ReferenceVariable)):
self._vars_read.append(var.points_to_origin) self._vars_read.append(var.points_to_origin)
elif isinstance(ir, (Member, Index)): elif isinstance(ir, (Member, Index)):
if self._is_non_slithir_var(ir.variable_right): var = ir.variable_left if isinstance(ir, Member) else ir.variable_right
self._vars_read.append(ir.variable_right) if self._is_non_slithir_var(var):
if isinstance(ir.variable_right, (ReferenceVariable)): self._vars_read.append(var)
origin = ir.variable_right.points_to_origin if isinstance(var, (ReferenceVariable)):
if self._is_non_slithir_var: origin = var.points_to_origin
if self._is_non_slithir_var(origin):
self._vars_read.append(origin) self._vars_read.append(origin)
if isinstance(ir, OperationWithLValue): if isinstance(ir, OperationWithLValue):

Loading…
Cancel
Save