diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-07-31 23:39:39 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-08-01 00:00:49 +0200 |
| commit | af9952c4c494a1c2848f167cb376139f5b884c07 (patch) | |
| tree | 92bad6c508396f3871bed0e3be3d21c5bec03fdc /miasm2/analysis/data_flow.py | |
| parent | 92e55ff555ea3705dfa03b62a72c22dded722389 (diff) | |
| download | miasm-af9952c4c494a1c2848f167cb376139f5b884c07.tar.gz miasm-af9952c4c494a1c2848f167cb376139f5b884c07.zip | |
Analysis: fix block simp (infinite loop)
Diffstat (limited to 'miasm2/analysis/data_flow.py')
| -rw-r--r-- | miasm2/analysis/data_flow.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/miasm2/analysis/data_flow.py b/miasm2/analysis/data_flow.py index bba598e0..a560e9b8 100644 --- a/miasm2/analysis/data_flow.py +++ b/miasm2/analysis/data_flow.py @@ -472,18 +472,22 @@ def merge_blocks(ircfg, loc_key_entries): # Test jmp only block son = _test_jmp_only(ircfg, loc_key) if son is not None and loc_key not in loc_key_entries: - modified |= _remove_to_son(ircfg, loc_key, son) - todo.add(loc_key) - continue + ret = _remove_to_son(ircfg, loc_key, son) + modified |= ret + if ret: + todo.add(loc_key) + continue # Test head jmp only block if (son is not None and son not in loc_key_entries and son in ircfg.blocks): # jmp only test done previously - modified |= _remove_to_parent(ircfg, loc_key, son) - todo.add(loc_key) - continue + ret = _remove_to_parent(ircfg, loc_key, son) + modified |= ret + if ret: + todo.add(loc_key) + continue return modified |