mirror of
https://github.com/angr/angr
synced 2026-08-17 12:23:11 -04:00
Follow-up to 90359a2b0, addressing code-review findings against the lowering pass itself. - LowerInsert tagged only the top-level Or with the original tags, so the generated Convert/Shl/And/Const nodes carried no ins_addr and the codegen's expression-to-address map had no entry for them. Every generated node now carries **expr.tags. - The width cutoff gated on arch.bits, which refused ordinary 64-bit Inserts on 32-bit targets even though they are plain long long arithmetic. Those reached the backend as _INSERT across the whole 32-bit family. The cutoff is now the widest C integer type. - _lower_residual_inserts discarded walk()'s return value. Handlers for nodes that cannot be rewritten in place (LoopNode above all) return a fresh node, so a replacement produced at the root was dropped and the lowering silently did not happen for it. - _lower_block built a fresh _PeepholeExprsWalker per block, rebuilding the dispatch table each time. It now reuses a cached walker, matching AILBlockSimplifier. Not addressed here: the stack-base and uninitialized-base bail-outs still let Inserts reach the C backend as _INSERT. Both defer to a rendering in _handle_Stmt_Assignment that is keyed on the assignment destination, which an expression-level peephole rule cannot see, so the fix belongs in the backend rather than in these bail-outs. Co-Authored-By: Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ailment | ||
| analyses | ||
| angrdb | ||
| engines | ||
| exploration_techniques | ||
| factory | ||
| gui | ||
| knowledge_plugins | ||
| llm | ||
| manual | ||
| mcp | ||
| misc | ||
| perf | ||
| procedures | ||
| regression | ||
| serialization | ||
| sim | ||
| simos | ||
| state_plugins | ||
| storage | ||
| types | ||
| utils | ||
| __init__.py | ||
| common.py | ||
| README.md | ||
| test_calling_conventions.py | ||
| test_cli.py | ||
| test_fuzzer.py | ||
| test_load_shellcode.py | ||
Tests
Running tests
These tests require the binaries repository, clone it in the folder where angr was cloned.
git clone https://github.com/angr/binaries
nose2 or pytest may be used to run tests.
Each tool can be installed with pip:
pip install nose2
pip install pytest
To run the tests with nose2, from the root of the repository, run:
nose2 -s tests
Or if using pytest, simply run:
pytest
Writing new tests
New tests should be written using unittest, part of Python's standard library. For more information about unittest, see https://docs.python.org/3/library/unittest.html. While we prefer nose2 and pytest for running tests, avoid using nose2 or pytest features in tests themselves, to avoid dependency on a specific runner.