about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2018-07-09 16:42:44 +0200
committerAjax <commial@gmail.com>2018-07-10 13:23:18 +0200
commit10003637521ecd370744f92ebb8ea023b31f5db0 (patch)
tree8184bb05e3d8c28b98c7ed4f0b7af456ac9af999
parent17d48de1951c81fc8b5b4184713a971537747227 (diff)
downloadmiasm-10003637521ecd370744f92ebb8ea023b31f5db0.tar.gz
miasm-10003637521ecd370744f92ebb8ea023b31f5db0.zip
TranslatorC: for uncommon size, use at least uint8
Diffstat (limited to '')
-rw-r--r--miasm2/ir/translators/C.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm2/ir/translators/C.py b/miasm2/ir/translators/C.py
index cafec7c8..fed07a6d 100644
--- a/miasm2/ir/translators/C.py
+++ b/miasm2/ir/translators/C.py
@@ -209,8 +209,8 @@ class TranslatorC(Translator):
         if expr.size in [8, 16, 32, 64, 128]:
             size = expr.size
         else:
-            # Uncommon expression size
-            size = expr.size
+            # Uncommon expression size, use at least uint8
+            size = max(expr.size, 8)
             next_power = 1
             while next_power <= size:
                 next_power <<= 1