about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2017-08-02 15:35:21 +0200
committerGitHub <noreply@github.com>2017-08-02 15:35:21 +0200
commit3cf2e78d109748e2af9060d5c7daddf7cb4d28a5 (patch)
tree02e4beac50f8b79b450a30a26216a0fce756b2a7
parent5b27a6e9978419f5317a65b9858697e8bd2eea66 (diff)
parent23b4198eac3f70e708ffcc3ccecb19dfa5cd497e (diff)
downloadmiasm-3cf2e78d109748e2af9060d5c7daddf7cb4d28a5.tar.gz
miasm-3cf2e78d109748e2af9060d5c7daddf7cb4d28a5.zip
Merge pull request #593 from eqv/bugfix_missing_atomic_release
fix atomic_mode leak
-rw-r--r--miasm2/core/cpu.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/miasm2/core/cpu.py b/miasm2/core/cpu.py
index 3502397d..aa94773f 100644
--- a/miasm2/core/cpu.py
+++ b/miasm2/core/cpu.py
@@ -1169,7 +1169,11 @@ class cls_mn(object):
                     if bs_l * 8 - offset_b < l:
                         getok = False
                         break
-                    bv = cls.getbits(bs, mode, offset_b, l)
+                    try:
+                        bv = cls.getbits(bs, mode, offset_b, l)
+                    except:
+                        bs_o.leave_atomic_mode()
+                        raise
                     offset_b += l
                     if not f.fname in fname_values:
                         fname_values[f.fname] = bv