about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/core/bin_stream.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/miasm2/core/bin_stream.py b/miasm2/core/bin_stream.py
index 739e671e..074290af 100644
--- a/miasm2/core/bin_stream.py
+++ b/miasm2/core/bin_stream.py
@@ -38,11 +38,13 @@ class bin_stream(object):
 
     def enter_atomic_mode(self):
         """Enter atomic mode. In this mode, read may be cached"""
+        assert not self._atomic_mode
         self._atomic_mode = True
         self._cache = BoundedDict(self.CACHE_SIZE)
 
     def leave_atomic_mode(self):
         """Leave atomic mode"""
+        assert self._atomic_mode
         self._atomic_mode = False
         self._cache = None