angr / ailment

AIL: The angr Intermediate Language.
BSD 2-Clause "Simplified" License
31 stars 17 forks source link

Fix(TaggedObject): Add `__new__` method #62

Closed ice-tong closed 2 years ago

ice-tong commented 3 years ago

Overwrite __new__ to prevent infinite recursion, which caused by using __getattr__ without initializing tags.

There is a possible situation:

from ailment import Assignment
import copy

stmt = Assignment(0, None, None)
copy.copy(stmt)
rhelmot commented 3 years ago

This change looks fine to me, other than the linting errors:

LINT FAILURE: ailment/tagged_object.py regressed to 8.85/9.55
... ailment/tagged_object.py:25:19: R1725: Consider using Python 3 style super() without arguments (super-with-arguments)
... ailment/tagged_object.py:27:0: W0613: Unused argument 'args' (unused-argument)
... ailment/tagged_object.py:27:0: W0613: Unused argument 'kwargs' (unused-argument)

@ltfish what do you think?

github-actions[bot] commented 2 years ago

This pull request has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

github-actions[bot] commented 2 years ago

This issue has been closed due to inactivity.