Repository navigation
Conversation
__contains__ raised KeyError for an address outside the view, so `addr in view` could not be used the way `addr in clemory` can: Clemory.__contains__ answers the question for any address, and a caller has to guard the view's version with a try/except to get the same answer.
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
No corpus comparison is offered. No loader path constructs a Workspace gate: not run. What ran instead is the scoped equivalent above: cle's own suite in an isolated Caveats: |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Membership through a Before — cle master 0e77adeAfter — with this change |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_819 |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
addr in viewraises instead of answering, whereaddr in clemoryanswers:So a caller cannot use a
ClemoryViewwhere it uses aClemorywithout wrapping everymembership test in a
try/except KeyError.Root cause
ClemoryView.__contains__raises for an address outside the view rather than reporting thatit is not in it:
The range check is right; only what it does with the answer is wrong.
Clemory.__contains__returns
Falsein the same situation, andinis defined to give a boolean.Fix
Return
False. The rest of the method is unchanged, and an address inside the view is stillanswered by asking the parent.
Nothing in
cleat0e77ade3,angrat87411a71orangr-managementataa843e5cconstructs a
ClemoryViewor subclasses one, so this has no in-tree caller; the class isexported from
cleand the method is wrong for anyone who does.Testing
tests/test_clemory.pygainstest_clemory_view_contains: both edges of the window, one pasteach end, and the same four addresses shifted for a view built with a non-zero
offset, whichpins that the answer is about the view's own address space. It fails on master with
KeyError: 16.Validation: #819 (comment)
session: sharpen