Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes two bugs in the Memory module (#1272)
The first bug was breaking the raw loader at least. It bug was introduced in #1178 during the `Memory.view` optimization. A check was missed that allowed for creation of invalid views. The invalid views later were caught with an assertion check, (easily reproduced with `bap /bin/ls --loader=raw`), e.g., ``` ("Assert_failure bap_memory.ml:72:2" "Raised at file \"bap_memory.ml\", line 72, characters 2-31\ \nCalled from file \"bap_memory.ml\", line 196, characters 2-18\ \nCalled from file \"bap_memory.ml\", line 410, characters 26-52\ \nCalled from file \"bap_trie.ml\", line 46, characters 34-53\ \nCalled from file \"bap_trie.ml\", line 62, characters 4-130\ \nCalled from file \"bap_byteweight.ml\", line 78, characters 12-39\ \nCalled from file \"bap_byteweight.ml\", line 129, characters 12-39\ \nCalled from file \"byteweight_main.ml\", line 50, characters 44-56\ \nCalled from file \"src/sequence.ml\", line 123, characters 29-36\ \nCalled from file \"byteweight_main.ml\" (inlined), line 49, characters 4-116\ \nCalled from file \"byteweight_main.ml\", line 48, characters 4-146\ ... ``` The second bug was probably all the time in the library and concerns `Memory.find_map` and `Memory.find_if`, which are talking an optional `word_size` parameter that was ignored and functions were always iterating over bytes.
- Loading branch information