angr icon indicating copy to clipboard operation
angr copied to clipboard

SimType & friends: Fully typecheck, fix observed bugs

Open rhelmot opened this issue 1 year ago • 4 comments

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.

rhelmot avatar Apr 25 '24 22:04 rhelmot

What do you think of using from __future__ import annotations?

ltfish avatar Apr 25 '24 22:04 ltfish

Done

rhelmot avatar Apr 25 '24 22:04 rhelmot

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.

ltfish avatar Apr 26 '24 00:04 ltfish

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.

rhelmot avatar Apr 26 '24 09:04 rhelmot