-
Notifications
You must be signed in to change notification settings - Fork 484
Fix several incorrect type hints #1668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…extmanager` do not agree with each other
The `dirfd` and `buf` parameters can be symbolic, and the type-checking that mypy does has trouble understanding `issymbolic`. So, un-type-hintify those parameters.
It turns out that the type of `data` in a couple methods is pretty flexible, and our tests use more than just `str`, `bytes`, and `List` types for that parameter. It is not quite clear what requirements there actually are on `data`, and so at least for now, get rid of the type hint there.
**kwargs could not have possibly worked in `AMD64Operand`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note: the |
Actually, I can reproduce the test failure locally, sporadically. It's always this error:
|
Remove unused import (thanks @ehennenfent!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes and discussion look good to me!
* master: (28 commits) Rework syscall invocation for proper behavior under typeguard (#1672) printable_bytes (#1671) Fix several incorrect type hints (#1668) Add type hints to several parts of Manticore (#1667) Fix type confusion in manual CPU tests; delete dead testing code (#1669) Rework WASM Imports and Fix Typos (#1666) Work on "Model is not Available" errors in tests (#1659) Fix TypeGuard Errors in WASM Module (#1601) Remove unused arg ans separate output from workspace (#1651) Add a badge to README.md for LGTM (#1647) Fix 2 problems in Linux `sys_open` support & add type hints (#1657) Fix LGTM Errors (#1656) Delay WASM Branch Condition Concretization (#1641) Add feature for SymbolicSocket through sys_accept (#1618) Add a bunch of type hints & fix a few issues with Linux platform emulation (#1645) Bump to CheckoutV2 (#1654) Add support for `sys_arm_fadvise64_64` (#1648) Add __slots__ to expressions (#1635) Swap remaining uses of `Z3Solver()` to use the singleton interface (#1649) CI: have pytest report 100 slowest tests (#1646) ...
Using typeguard in local test runs (see #1584), I found several issues where type hints in Manticore are in fact not accurate at runtime.
This pull request fixes nearly all of those, and additionally fixes a couple bugs.