angr
angr copied to clipboard
SimType & friends: Fully typecheck, fix observed bugs
This involved making several classes NOT subclasses of other classes, since doing so would violate the Liskov Substitution Principle. Several bugs were discovered while making these changes, they were all fixed.
Type-checking was done with pyright.
What do you think of using from __future__ import annotations?
Done
By the way I find the (name of the) SimTypeReg class a bit misleading since some of its subclasses, such as SimTypeChar, are not necessarily register-sized.
for some inconceivable reason, some of the numeric types allow parametrizing themselves with size=None, and there are in fact cases to handle this strewn about the simtype code, so I can only assume this is actually used.