polystat / odin

Object Dependency Inspector
10 stars 2 forks source link

Revisiting direct state access analyzer #66

Closed Leosimetti closed 2 years ago

Leosimetti commented 2 years ago

The following fixes are present in this PR:

  1. Adjusted the message to better reflect the location of accessed state and the base object; BEFORE: Method 'func' of object 'b' directly accesses state 'hidden_state' of base class 'base.inner_state.very_inner_state' AFTER: Method 'func' of object 'test.b' directly accesses state 'inner_state.very_inner_state.hidden_state' of base class 'test.nested.base'
  2. Fixed a bug which prevented nested state access from being detected. EXAMPLE:
    [] > parent
    memory > state
    [] > child
    parent > @
    [self] > method
    seq > @
      s689401025
    [] > s689401025
      b306980751 > @
    [] > b306980751
      s_r1826699684.add > @
        s_r1769193365
    [] > s_r1826699684
      self.state > @
    [] > s_r1769193365
      5 > @

    EXPECTED OUTPUT: Method 'method' of object 'child' directly accesses state 'state' of base class 'parent