crosshair-tool 0.0.85__tar.gz → 0.0.87__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of crosshair-tool might be problematic. Click here for more details.
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/PKG-INFO +38 -3
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/__init__.py +1 -1
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/_mark_stacks.h +2 -19
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/auditwall.py +8 -5
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/builtinslib.py +11 -277
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/builtinslib_test.py +1 -1
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/typeslib_test.py +2 -1
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/opcode_intercept.py +110 -41
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/opcode_intercept_test.py +85 -5
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/statespace.py +9 -4
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/util.py +3 -1
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair_tool.egg-info/PKG-INFO +38 -3
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair_tool.egg-info/requires.txt +5 -5
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/setup.py +2 -2
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/LICENSE +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/README.md +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/__main__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/_preliminaries_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/_tracers.c +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/_tracers.h +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/_tracers_pycompat.h +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/_tracers_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/abcstring.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/auditwall_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/codeconfig.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/codeconfig_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/condition_parser.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/condition_parser_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/conftest.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/copyext.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/copyext_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/core.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/core_and_libs.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/core_regestered_types_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/core_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/diff_behavior.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/diff_behavior_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/dynamic_typing.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/dynamic_typing_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/enforce.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/enforce_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/bugs_detected/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/bugs_detected/getattr_magic.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/bugs_detected/hash_consistent_with_equals.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/bugs_detected/shopping_cart.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/bugs_detected/showcase.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/arith.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/chess.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/nesting_inference.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/numpy_examples.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/rolling_average.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/PEP316/correct_code/showcase.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/check_examples_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/deal/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/bugs_detected/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/bugs_detected/showcase.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/bugs_detected/wrong_sign.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/correct_code/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/correct_code/arith.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/examples/icontract/correct_code/showcase.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/fnutil.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/fnutil_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/fuzz_core_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/arraylib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/binascii_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/binascii_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/binasciilib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/bisectlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/builtinslib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/codecslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/codecslib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/collectionslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/collectionslib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/collectionslib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/copylib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/datetimelib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/datetimelib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/datetimelib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/decimallib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/decimallib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/decimallib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/encodings/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/encodings/_encutil.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/encodings/ascii.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/encodings/latin_1.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/encodings/utf_8.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/encodings_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/fractionlib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/fractionlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/functoolslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/functoolslib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/hashliblib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/hashliblib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/heapqlib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/heapqlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/importliblib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/importliblib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/iolib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/iolib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/iolib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/ipaddresslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/itertoolslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/itertoolslib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/jsonlib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/jsonlib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/jsonlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/mathlib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/mathlib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/mathlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/oslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/pathliblib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/randomlib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/randomlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/relib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/relib_ch_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/relib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/timelib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/timelib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/typeslib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/unicodedatalib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/unicodedatalib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/urlliblib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/urlliblib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/weakreflib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/weakreflib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/zliblib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/libimpl/zliblib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/lsp_server.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/lsp_server_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/main.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/main_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/objectproxy.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/objectproxy_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/options.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/options_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/patch_equivalence_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/path_cover.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/path_cover_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/path_search.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/path_search_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/pathing_oracle.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/pure_importer.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/pure_importer_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/py.typed +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/register_contract.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/register_contract_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/simplestructs.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/simplestructs_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/smtlib.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/smtlib_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/statespace_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/stubs_parser.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/stubs_parser_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/test_util.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/test_util_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/tools/__init__.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/tools/check_help_in_doc.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/tools/check_init_and_setup_coincide.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/tools/generate_demo_table.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/tracers.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/tracers_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/type_repo.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/unicode_categories.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/unicode_categories_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/util_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/watcher.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/watcher_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/z3util.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair/z3util_test.py +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair_tool.egg-info/SOURCES.txt +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair_tool.egg-info/dependency_links.txt +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair_tool.egg-info/entry_points.txt +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/crosshair_tool.egg-info/top_level.txt +0 -0
- {crosshair-tool-0.0.85 → crosshair_tool-0.0.87}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: crosshair-tool
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.87
|
|
4
4
|
Summary: Analyze Python code for correctness using symbolic execution.
|
|
5
5
|
Home-page: https://github.com/pschanely/CrossHair
|
|
6
6
|
Author: Phillip Schanely
|
|
@@ -22,8 +22,43 @@ Classifier: Topic :: Software Development :: Quality Assurance
|
|
|
22
22
|
Classifier: Topic :: Software Development :: Testing
|
|
23
23
|
Requires-Python: >=3.8
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
|
-
Provides-Extra: dev
|
|
26
25
|
License-File: LICENSE
|
|
26
|
+
Requires-Dist: packaging
|
|
27
|
+
Requires-Dist: typing-inspect>=0.7.1
|
|
28
|
+
Requires-Dist: typing_extensions>=3.10.0
|
|
29
|
+
Requires-Dist: z3-solver>=4.13.0.0
|
|
30
|
+
Requires-Dist: importlib_metadata>=4.0.0
|
|
31
|
+
Requires-Dist: pygls>=1.0.0
|
|
32
|
+
Requires-Dist: typeshed-client>=2.0.5
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: autodocsumm<1,>=0.2.2; extra == "dev"
|
|
35
|
+
Requires-Dist: black==22.3.0; extra == "dev"
|
|
36
|
+
Requires-Dist: deal>=4.13.0; extra == "dev"
|
|
37
|
+
Requires-Dist: icontract>=2.4.0; extra == "dev"
|
|
38
|
+
Requires-Dist: isort==5.11.5; extra == "dev"
|
|
39
|
+
Requires-Dist: mypy==0.990; extra == "dev"
|
|
40
|
+
Requires-Dist: numpy==1.23.4; python_version < "3.12" and extra == "dev"
|
|
41
|
+
Requires-Dist: numpy==1.26.0; (python_version >= "3.12" and python_version < "3.13") and extra == "dev"
|
|
42
|
+
Requires-Dist: numpy==2.0.1; python_version >= "3.13" and extra == "dev"
|
|
43
|
+
Requires-Dist: pre-commit~=2.20; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest; extra == "dev"
|
|
45
|
+
Requires-Dist: pytest-xdist; extra == "dev"
|
|
46
|
+
Requires-Dist: setuptools; extra == "dev"
|
|
47
|
+
Requires-Dist: sphinx>=3.4.3; extra == "dev"
|
|
48
|
+
Requires-Dist: sphinx-rtd-theme>=0.5.1; extra == "dev"
|
|
49
|
+
Requires-Dist: rst2pdf>=0.102; extra == "dev"
|
|
50
|
+
Dynamic: author
|
|
51
|
+
Dynamic: author-email
|
|
52
|
+
Dynamic: classifier
|
|
53
|
+
Dynamic: description
|
|
54
|
+
Dynamic: description-content-type
|
|
55
|
+
Dynamic: home-page
|
|
56
|
+
Dynamic: license
|
|
57
|
+
Dynamic: license-file
|
|
58
|
+
Dynamic: provides-extra
|
|
59
|
+
Dynamic: requires-dist
|
|
60
|
+
Dynamic: requires-python
|
|
61
|
+
Dynamic: summary
|
|
27
62
|
|
|
28
63
|
<img src="https://raw.githubusercontent.com/pschanely/CrossHair/main/doc/source/logo-gray.png" width="5%" align="left">
|
|
29
64
|
|
|
@@ -15,7 +15,7 @@ from crosshair.statespace import StateSpace
|
|
|
15
15
|
from crosshair.tracers import NoTracing, ResumedTracing
|
|
16
16
|
from crosshair.util import IgnoreAttempt, debug
|
|
17
17
|
|
|
18
|
-
__version__ = "0.0.
|
|
18
|
+
__version__ = "0.0.87" # Do not forget to update in setup.py!
|
|
19
19
|
__author__ = "Phillip Schanely"
|
|
20
20
|
__license__ = "MIT"
|
|
21
21
|
__status__ = "Alpha"
|
|
@@ -538,23 +538,6 @@ static const uint8_t _ch_DE_INSTRUMENT[256] = {
|
|
|
538
538
|
#endif
|
|
539
539
|
#endif
|
|
540
540
|
|
|
541
|
-
/* Get the underlying opcode, stripping instrumentation */
|
|
542
|
-
int _ch_Py_GetBaseOpcode(PyCodeObject *code, int i)
|
|
543
|
-
{
|
|
544
|
-
int opcode = _PyCode_CODE(code)[i].op.code;
|
|
545
|
-
if (opcode == INSTRUMENTED_LINE) {
|
|
546
|
-
opcode = code->_co_monitoring->lines[i].original_opcode;
|
|
547
|
-
}
|
|
548
|
-
if (opcode == INSTRUMENTED_INSTRUCTION) {
|
|
549
|
-
opcode = code->_co_monitoring->per_instruction_opcodes[i];
|
|
550
|
-
}
|
|
551
|
-
int deinstrumented = _ch_DE_INSTRUMENT[opcode];
|
|
552
|
-
if (deinstrumented) {
|
|
553
|
-
return deinstrumented;
|
|
554
|
-
}
|
|
555
|
-
return _ch_PyOpcode_Deopt[opcode];
|
|
556
|
-
}
|
|
557
|
-
|
|
558
541
|
static int64_t *
|
|
559
542
|
_ch_mark_stacks(PyCodeObject *code_obj, int len)
|
|
560
543
|
{
|
|
@@ -602,14 +585,14 @@ _ch_mark_stacks(PyCodeObject *code_obj, int len)
|
|
|
602
585
|
/* Scan instructions */
|
|
603
586
|
for (i = 0; i < len;) {
|
|
604
587
|
int64_t next_stack = stacks[i];
|
|
605
|
-
opcode =
|
|
588
|
+
opcode = code[i].op.code;
|
|
606
589
|
uint8_t trace_enabled_here = _ch_TRACABLE_INSTRUCTIONS[opcode];
|
|
607
590
|
enabled_tracing[i] |= trace_enabled_here;
|
|
608
591
|
int oparg = 0;
|
|
609
592
|
while (opcode == EXTENDED_ARG) {
|
|
610
593
|
oparg = (oparg << 8) | code[i].op.arg;
|
|
611
594
|
i++;
|
|
612
|
-
opcode =
|
|
595
|
+
opcode = code[i].op.code;
|
|
613
596
|
stacks[i] = next_stack;
|
|
614
597
|
}
|
|
615
598
|
int next_i = i + _ch_PyOpcode_Caches[opcode] + 1;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import importlib
|
|
2
|
+
import inspect
|
|
2
3
|
import os
|
|
3
4
|
import sys
|
|
4
5
|
import traceback
|
|
@@ -28,9 +29,10 @@ def reject(event: str, args: Tuple) -> None:
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def inside_module(modules: Iterable[ModuleType]) -> bool:
|
|
31
|
-
|
|
32
|
-
for frame,
|
|
33
|
-
|
|
32
|
+
"""Checks whether the current call stack is inside one of the given modules."""
|
|
33
|
+
for frame, _lineno in traceback.walk_stack(None):
|
|
34
|
+
frame_module = inspect.getmodule(frame)
|
|
35
|
+
if frame_module and frame_module in modules:
|
|
34
36
|
return True
|
|
35
37
|
return False
|
|
36
38
|
|
|
@@ -60,7 +62,7 @@ def check_msvcrt_open(event: str, args: Tuple) -> None:
|
|
|
60
62
|
_MODULES_THAT_CAN_POPEN: Optional[Set[ModuleType]] = None
|
|
61
63
|
|
|
62
64
|
|
|
63
|
-
def
|
|
65
|
+
def modules_with_allowed_subprocess():
|
|
64
66
|
global _MODULES_THAT_CAN_POPEN
|
|
65
67
|
if _MODULES_THAT_CAN_POPEN is None:
|
|
66
68
|
allowed_module_names = ("_aix_support", "ctypes", "platform", "uuid")
|
|
@@ -74,13 +76,14 @@ def modules_with_allowed_popen():
|
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
def check_subprocess(event: str, args: Tuple) -> None:
|
|
77
|
-
if not inside_module(
|
|
79
|
+
if not inside_module(modules_with_allowed_subprocess()):
|
|
78
80
|
reject(event, args)
|
|
79
81
|
|
|
80
82
|
|
|
81
83
|
_SPECIAL_HANDLERS = {
|
|
82
84
|
"open": check_open,
|
|
83
85
|
"subprocess.Popen": check_subprocess,
|
|
86
|
+
"os.posix_spawn": check_subprocess,
|
|
84
87
|
"msvcrt.open_osfhandle": check_msvcrt_open,
|
|
85
88
|
}
|
|
86
89
|
|
|
@@ -267,7 +267,7 @@ class SymbolicValue(CrossHairValue):
|
|
|
267
267
|
self.snapshot = SnapshotRef(-1)
|
|
268
268
|
self.python_type = typ
|
|
269
269
|
if type(smtvar) is str:
|
|
270
|
-
self.var = self.__init_var__(typ, smtvar)
|
|
270
|
+
self.var: Any = self.__init_var__(typ, smtvar)
|
|
271
271
|
else:
|
|
272
272
|
self.var = smtvar
|
|
273
273
|
# TODO test that smtvar's sort matches expected?
|
|
@@ -402,6 +402,10 @@ def crosshair_types_for_python_type(
|
|
|
402
402
|
return _PYTYPE_TO_WRAPPER_TYPE.get(origin, ())
|
|
403
403
|
|
|
404
404
|
|
|
405
|
+
def python_types_using_atomic_symbolics() -> Iterable[Type[AtomicSymbolicValue]]:
|
|
406
|
+
return _PYTYPE_TO_WRAPPER_TYPE.keys()
|
|
407
|
+
|
|
408
|
+
|
|
405
409
|
class ModelingDirector:
|
|
406
410
|
def __init__(self, *a) -> None:
|
|
407
411
|
# Maps python type to the symbolic type we've chosen to represent it (on this iteration)
|
|
@@ -834,19 +838,6 @@ def setup_binops():
|
|
|
834
838
|
|
|
835
839
|
setup_binop(_, {ops.lshift, ops.rshift})
|
|
836
840
|
|
|
837
|
-
_AND_MASKS_TO_MOD = {
|
|
838
|
-
# It's common to use & to mask low bits. We can avoid realization by converting
|
|
839
|
-
# these situations into mod operations.
|
|
840
|
-
0x01: 2,
|
|
841
|
-
0x03: 4,
|
|
842
|
-
0x07: 8,
|
|
843
|
-
0x0F: 16,
|
|
844
|
-
0x1F: 32,
|
|
845
|
-
0x3F: 64,
|
|
846
|
-
0x7F: 128,
|
|
847
|
-
0xFF: 256,
|
|
848
|
-
}
|
|
849
|
-
|
|
850
841
|
def _(op: BinFn, a: Integral, b: Integral):
|
|
851
842
|
with NoTracing():
|
|
852
843
|
if isinstance(b, SymbolicInt):
|
|
@@ -857,9 +848,12 @@ def setup_binops():
|
|
|
857
848
|
b = realize(b)
|
|
858
849
|
if b == 0:
|
|
859
850
|
return 0
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
851
|
+
# It's common to use & to mask low bits. We can avoid realization by converting
|
|
852
|
+
# these situations into mod operations.
|
|
853
|
+
mask_mod = b + 1
|
|
854
|
+
if b > 0 and mask_mod & b == 0 and isinstance(a, SymbolicInt): # type: ignore
|
|
855
|
+
space = context_statespace()
|
|
856
|
+
if space.smt_fork(a.var >= 0, probability_true=0.75):
|
|
863
857
|
return SymbolicInt(a.var % mask_mod)
|
|
864
858
|
else:
|
|
865
859
|
return SymbolicInt(b - ((-a.var - 1) % mask_mod))
|
|
@@ -3488,10 +3482,6 @@ class LazyIntSymbolicStr(AnySymbolicStr, CrossHairValue):
|
|
|
3488
3482
|
otherpoints = [ord(ch) for ch in other]
|
|
3489
3483
|
with ResumedTracing():
|
|
3490
3484
|
return mypoints.__eq__(otherpoints)
|
|
3491
|
-
elif isinstance(other, SeqBasedSymbolicStr):
|
|
3492
|
-
with ResumedTracing():
|
|
3493
|
-
otherpoints = [ord(ch) for ch in other]
|
|
3494
|
-
return mypoints.__eq__(otherpoints)
|
|
3495
3485
|
else:
|
|
3496
3486
|
return NotImplemented
|
|
3497
3487
|
|
|
@@ -3660,257 +3650,6 @@ class LazyIntSymbolicStr(AnySymbolicStr, CrossHairValue):
|
|
|
3660
3650
|
return self._find(substr, start, end, from_right=True)
|
|
3661
3651
|
|
|
3662
3652
|
|
|
3663
|
-
class SeqBasedSymbolicStr(AtomicSymbolicValue, SymbolicSequence, AnySymbolicStr):
|
|
3664
|
-
def __init__(self, smtvar: Union[str, z3.ExprRef], typ: Type = str):
|
|
3665
|
-
assert typ == str
|
|
3666
|
-
SymbolicValue.__init__(self, smtvar, typ)
|
|
3667
|
-
self.item_pytype = str
|
|
3668
|
-
if isinstance(smtvar, str):
|
|
3669
|
-
# Constrain fresh strings to valid codepoints
|
|
3670
|
-
space = context_statespace()
|
|
3671
|
-
idxvar = z3.Int("idxvar" + space.uniq())
|
|
3672
|
-
z3seq = self.var
|
|
3673
|
-
space.add(
|
|
3674
|
-
z3.ForAll(
|
|
3675
|
-
[idxvar], z3.And(0 <= z3seq[idxvar], z3seq[idxvar] <= maxunicode)
|
|
3676
|
-
)
|
|
3677
|
-
)
|
|
3678
|
-
|
|
3679
|
-
@classmethod
|
|
3680
|
-
def _ch_smt_sort(cls) -> z3.SortRef:
|
|
3681
|
-
return z3.SeqSort(z3.IntSort())
|
|
3682
|
-
|
|
3683
|
-
@classmethod
|
|
3684
|
-
def _pytype(cls) -> Type:
|
|
3685
|
-
return str
|
|
3686
|
-
|
|
3687
|
-
@classmethod
|
|
3688
|
-
def _smt_promote_literal(cls, literal) -> Optional[z3.SortRef]:
|
|
3689
|
-
if isinstance(literal, str):
|
|
3690
|
-
if len(literal) <= 1:
|
|
3691
|
-
if len(literal) == 0:
|
|
3692
|
-
return z3.Empty(z3.SeqSort(z3.IntSort()))
|
|
3693
|
-
return z3.Unit(z3IntVal(ord(literal)))
|
|
3694
|
-
return z3.Concat([z3.Unit(z3IntVal(ord(ch))) for ch in literal])
|
|
3695
|
-
return None
|
|
3696
|
-
|
|
3697
|
-
def __ch_realize__(self) -> object:
|
|
3698
|
-
codepoints = context_statespace().find_model_value(self.var)
|
|
3699
|
-
return "".join(chr(x) for x in codepoints)
|
|
3700
|
-
|
|
3701
|
-
def __copy__(self):
|
|
3702
|
-
return SeqBasedSymbolicStr(self.var)
|
|
3703
|
-
|
|
3704
|
-
def __hash__(self):
|
|
3705
|
-
return hash(self.__str__())
|
|
3706
|
-
|
|
3707
|
-
@staticmethod
|
|
3708
|
-
def _concat_strings(
|
|
3709
|
-
a: Union[str, "SeqBasedSymbolicStr"], b: Union[str, "SeqBasedSymbolicStr"]
|
|
3710
|
-
) -> Union[str, "SeqBasedSymbolicStr"]:
|
|
3711
|
-
assert not is_tracing()
|
|
3712
|
-
# Assumes at least one argument is symbolic and not tracing
|
|
3713
|
-
if isinstance(a, SeqBasedSymbolicStr) and isinstance(b, SeqBasedSymbolicStr):
|
|
3714
|
-
return SeqBasedSymbolicStr(a.var + b.var)
|
|
3715
|
-
elif isinstance(a, str) and isinstance(b, SeqBasedSymbolicStr):
|
|
3716
|
-
return SeqBasedSymbolicStr(
|
|
3717
|
-
SeqBasedSymbolicStr._coerce_to_smt_sort(a) + b.var
|
|
3718
|
-
)
|
|
3719
|
-
else:
|
|
3720
|
-
assert isinstance(a, SeqBasedSymbolicStr)
|
|
3721
|
-
assert isinstance(b, str)
|
|
3722
|
-
return SeqBasedSymbolicStr(
|
|
3723
|
-
a.var + SeqBasedSymbolicStr._coerce_to_smt_sort(b)
|
|
3724
|
-
)
|
|
3725
|
-
|
|
3726
|
-
def __add__(self, other):
|
|
3727
|
-
with NoTracing():
|
|
3728
|
-
if isinstance(other, (SeqBasedSymbolicStr, str)):
|
|
3729
|
-
return SeqBasedSymbolicStr._concat_strings(self, other)
|
|
3730
|
-
if isinstance(other, AnySymbolicStr):
|
|
3731
|
-
return NotImplemented
|
|
3732
|
-
raise TypeError
|
|
3733
|
-
|
|
3734
|
-
def __radd__(self, other):
|
|
3735
|
-
with NoTracing():
|
|
3736
|
-
if isinstance(other, (SeqBasedSymbolicStr, str)):
|
|
3737
|
-
return SeqBasedSymbolicStr._concat_strings(other, self)
|
|
3738
|
-
if isinstance(other, AnySymbolicStr):
|
|
3739
|
-
return NotImplemented
|
|
3740
|
-
raise TypeError
|
|
3741
|
-
|
|
3742
|
-
def __mul__(self, other):
|
|
3743
|
-
if isinstance(other, Integral):
|
|
3744
|
-
if other <= 1:
|
|
3745
|
-
return self if other == 1 else ""
|
|
3746
|
-
# Note that in SymbolicInt, we attempt string multiplication via regex.
|
|
3747
|
-
# Z3 cannot do much with a symbolic regex, so we case-split on
|
|
3748
|
-
# the repetition count.
|
|
3749
|
-
return SeqBasedSymbolicStr(z3.Concat(*[self.var for _ in range(other)]))
|
|
3750
|
-
return NotImplemented
|
|
3751
|
-
|
|
3752
|
-
__rmul__ = __mul__
|
|
3753
|
-
|
|
3754
|
-
def __mod__(self, other):
|
|
3755
|
-
return self.__str__() % realize(other)
|
|
3756
|
-
|
|
3757
|
-
def __contains__(self, other):
|
|
3758
|
-
with NoTracing():
|
|
3759
|
-
forced = force_to_smt_sort(other, SeqBasedSymbolicStr)
|
|
3760
|
-
return SymbolicBool(z3.Contains(self.var, forced))
|
|
3761
|
-
|
|
3762
|
-
def __getitem__(self, i: Union[int, slice]):
|
|
3763
|
-
with NoTracing():
|
|
3764
|
-
idx_or_pair = process_slice_vs_symbolic_len(
|
|
3765
|
-
context_statespace(), i, z3.Length(self.var)
|
|
3766
|
-
)
|
|
3767
|
-
if isinstance(idx_or_pair, tuple):
|
|
3768
|
-
(start, stop) = idx_or_pair
|
|
3769
|
-
smt_result = z3.Extract(self.var, start, stop - start)
|
|
3770
|
-
else:
|
|
3771
|
-
smt_result = z3.Unit(self.var[idx_or_pair])
|
|
3772
|
-
return SeqBasedSymbolicStr(smt_result)
|
|
3773
|
-
|
|
3774
|
-
def endswith(self, substr):
|
|
3775
|
-
with NoTracing():
|
|
3776
|
-
smt_substr = force_to_smt_sort(substr, SeqBasedSymbolicStr)
|
|
3777
|
-
return SymbolicBool(z3.SuffixOf(smt_substr, self.var))
|
|
3778
|
-
|
|
3779
|
-
def find(self, substr, start=None, end=None):
|
|
3780
|
-
if not isinstance(substr, str):
|
|
3781
|
-
raise TypeError
|
|
3782
|
-
with NoTracing():
|
|
3783
|
-
space = context_statespace()
|
|
3784
|
-
smt_my_len = z3.Length(self.var)
|
|
3785
|
-
if start is None and end is None:
|
|
3786
|
-
smt_start = z3IntVal(0)
|
|
3787
|
-
smt_end = smt_my_len
|
|
3788
|
-
smt_str = self.var
|
|
3789
|
-
if len(substr) == 0:
|
|
3790
|
-
return 0
|
|
3791
|
-
else:
|
|
3792
|
-
(smt_start, smt_end) = flip_slice_vs_symbolic_len(
|
|
3793
|
-
space, slice(start, end, None), smt_my_len
|
|
3794
|
-
)
|
|
3795
|
-
if len(substr) == 0:
|
|
3796
|
-
# Add oddity of CPython. We can find the empty string when over-slicing
|
|
3797
|
-
# off the left side of the string, but not off the right:
|
|
3798
|
-
# ''.find('', 3, 4) == -1
|
|
3799
|
-
# ''.find('', -4, -3) == 0
|
|
3800
|
-
if space.smt_fork(smt_start > smt_my_len):
|
|
3801
|
-
return -1
|
|
3802
|
-
elif space.smt_fork(smt_start > 0):
|
|
3803
|
-
return SymbolicInt(smt_start)
|
|
3804
|
-
else:
|
|
3805
|
-
return 0
|
|
3806
|
-
(smt_start, smt_end) = clip_range_to_symbolic_len(
|
|
3807
|
-
space, smt_start, smt_end, smt_my_len
|
|
3808
|
-
)
|
|
3809
|
-
smt_str = z3.SubString(self.var, smt_start, smt_end - smt_start)
|
|
3810
|
-
|
|
3811
|
-
smt_sub = force_to_smt_sort(substr, SeqBasedSymbolicStr)
|
|
3812
|
-
if space.smt_fork(z3.Contains(smt_str, smt_sub)):
|
|
3813
|
-
return SymbolicInt(z3.IndexOf(smt_str, smt_sub, 0) + smt_start)
|
|
3814
|
-
else:
|
|
3815
|
-
return -1
|
|
3816
|
-
|
|
3817
|
-
def partition(self, sep: str):
|
|
3818
|
-
if not isinstance(sep, str):
|
|
3819
|
-
raise TypeError
|
|
3820
|
-
if len(sep) == 0:
|
|
3821
|
-
raise ValueError
|
|
3822
|
-
with NoTracing():
|
|
3823
|
-
space = context_statespace()
|
|
3824
|
-
smt_str = self.var
|
|
3825
|
-
smt_sep = force_to_smt_sort(sep, SeqBasedSymbolicStr)
|
|
3826
|
-
if space.smt_fork(z3.Contains(smt_str, smt_sep)):
|
|
3827
|
-
uniq = space.uniq()
|
|
3828
|
-
# Divide my contents into 4 concatenated parts:
|
|
3829
|
-
prefix = SeqBasedSymbolicStr(f"prefix{uniq}")
|
|
3830
|
-
match1 = SeqBasedSymbolicStr(
|
|
3831
|
-
f"match1{uniq}"
|
|
3832
|
-
) # the first character of the match
|
|
3833
|
-
match_tail = SeqBasedSymbolicStr(f"match_tail{uniq}")
|
|
3834
|
-
suffix = SeqBasedSymbolicStr(f"suffix{uniq}")
|
|
3835
|
-
space.add(z3.Length(match1.var) == 1)
|
|
3836
|
-
space.add(smt_sep == z3.Concat(match1.var, match_tail.var))
|
|
3837
|
-
space.add(smt_str == z3.Concat(prefix.var, smt_sep, suffix.var))
|
|
3838
|
-
space.add(
|
|
3839
|
-
z3.Not(z3.Contains(z3.Concat(match_tail.var, suffix.var), smt_sep))
|
|
3840
|
-
)
|
|
3841
|
-
return (prefix, sep, suffix)
|
|
3842
|
-
else:
|
|
3843
|
-
return (self, "", "")
|
|
3844
|
-
|
|
3845
|
-
def rfind(self, substr, start=None, end=None) -> Union[int, SymbolicInt]:
|
|
3846
|
-
if not isinstance(substr, str):
|
|
3847
|
-
raise TypeError
|
|
3848
|
-
with NoTracing():
|
|
3849
|
-
space = context_statespace()
|
|
3850
|
-
smt_my_len = z3.Length(self.var)
|
|
3851
|
-
if start is None and end is None:
|
|
3852
|
-
smt_start = z3IntVal(0)
|
|
3853
|
-
smt_end = smt_my_len
|
|
3854
|
-
smt_str = self.var
|
|
3855
|
-
if len(substr) == 0:
|
|
3856
|
-
return SymbolicInt(smt_my_len)
|
|
3857
|
-
else:
|
|
3858
|
-
(smt_start, smt_end) = flip_slice_vs_symbolic_len(
|
|
3859
|
-
space, slice(start, end, None), smt_my_len
|
|
3860
|
-
)
|
|
3861
|
-
if len(substr) == 0:
|
|
3862
|
-
# Add oddity of CPython. We can find the empty string when over-slicing
|
|
3863
|
-
# off the left side of the string, but not off the right:
|
|
3864
|
-
# ''.find('', 3, 4) == -1
|
|
3865
|
-
# ''.find('', -4, -3) == 0
|
|
3866
|
-
if space.smt_fork(smt_start > smt_my_len):
|
|
3867
|
-
return -1
|
|
3868
|
-
elif space.smt_fork(smt_end < 0):
|
|
3869
|
-
return 0
|
|
3870
|
-
elif space.smt_fork(smt_end < smt_my_len):
|
|
3871
|
-
return SymbolicInt(smt_end)
|
|
3872
|
-
else:
|
|
3873
|
-
return SymbolicInt(smt_my_len)
|
|
3874
|
-
(smt_start, smt_end) = clip_range_to_symbolic_len(
|
|
3875
|
-
space, smt_start, smt_end, smt_my_len
|
|
3876
|
-
)
|
|
3877
|
-
smt_str = z3.SubString(self.var, smt_start, smt_end - smt_start)
|
|
3878
|
-
smt_sub = force_to_smt_sort(substr, SeqBasedSymbolicStr)
|
|
3879
|
-
if space.smt_fork(z3.Contains(smt_str, smt_sub)):
|
|
3880
|
-
uniq = space.uniq()
|
|
3881
|
-
# Divide my contents into 4 concatenated parts:
|
|
3882
|
-
prefix = SeqBasedSymbolicStr(f"prefix{uniq}")
|
|
3883
|
-
match1 = SeqBasedSymbolicStr(f"match1{uniq}")
|
|
3884
|
-
match_tail = SeqBasedSymbolicStr(f"match_tail{uniq}")
|
|
3885
|
-
suffix = SeqBasedSymbolicStr(f"suffix{uniq}")
|
|
3886
|
-
space.add(z3.Length(match1.var) == 1)
|
|
3887
|
-
space.add(smt_sub == z3.Concat(match1.var, match_tail.var))
|
|
3888
|
-
space.add(smt_str == z3.Concat(prefix.var, smt_sub, suffix.var))
|
|
3889
|
-
space.add(
|
|
3890
|
-
z3.Not(z3.Contains(z3.Concat(match_tail.var, suffix.var), smt_sub))
|
|
3891
|
-
)
|
|
3892
|
-
return SymbolicInt(smt_start + z3.Length(prefix.var))
|
|
3893
|
-
else:
|
|
3894
|
-
return -1
|
|
3895
|
-
|
|
3896
|
-
def rpartition(self, sep: str):
|
|
3897
|
-
result = self.rsplit(sep, maxsplit=1)
|
|
3898
|
-
if len(result) == 1:
|
|
3899
|
-
return ("", "", self)
|
|
3900
|
-
elif len(result) == 2:
|
|
3901
|
-
return (result[0], sep, result[1])
|
|
3902
|
-
|
|
3903
|
-
def startswith(self, substr, start=None, end=None):
|
|
3904
|
-
if isinstance(substr, tuple):
|
|
3905
|
-
return any(self.startswith(s, start, end) for s in substr)
|
|
3906
|
-
smt_substr = force_to_smt_sort(substr, SeqBasedSymbolicStr)
|
|
3907
|
-
if start is not None or end is not None:
|
|
3908
|
-
# TODO: "".startswith("", 1) should be False, not True
|
|
3909
|
-
return self[start:end].startswith(substr)
|
|
3910
|
-
with NoTracing():
|
|
3911
|
-
return SymbolicBool(z3.PrefixOf(smt_substr, self.var))
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
3653
|
def buffer_to_byte_seq(obj: object) -> Optional[Sequence[int]]:
|
|
3915
3654
|
if isinstance(obj, (bytes, bytearray)):
|
|
3916
3655
|
return list(obj)
|
|
@@ -4822,11 +4561,6 @@ def _ord(c: str) -> int:
|
|
|
4822
4561
|
with NoTracing():
|
|
4823
4562
|
if isinstance(c, LazyIntSymbolicStr):
|
|
4824
4563
|
return c._codepoints[0]
|
|
4825
|
-
elif isinstance(c, SeqBasedSymbolicStr):
|
|
4826
|
-
space = context_statespace()
|
|
4827
|
-
ret = SymbolicInt("ord" + space.uniq())
|
|
4828
|
-
space.add(c.var == z3.Unit(ret.var))
|
|
4829
|
-
return ret
|
|
4830
4564
|
return ord(realize(c))
|
|
4831
4565
|
|
|
4832
4566
|
|
|
@@ -30,6 +30,7 @@ def test_mappingproxy_deep_realize(space):
|
|
|
30
30
|
assert type(copy) is MappingProxyType
|
|
31
31
|
with ResumedTracing():
|
|
32
32
|
val_from_orig = orig[key]
|
|
33
|
-
|
|
33
|
+
realized_key = deep_realize(key)
|
|
34
|
+
val_from_copy = copy[realized_key]
|
|
34
35
|
assert type(val_from_orig) is SymbolicInt
|
|
35
36
|
assert type(val_from_copy) is int
|