about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-11-08 09:49:25 +0100
committerChristian Krinitsin <mail@krinitsin.com>2025-11-08 09:49:25 +0100
commit3659d5cdc2ae42908fcae70ddb16af669027c344 (patch)
treeb4a2888aec8bc07c9fdcadf1dc4a645b973dbce5
parentb191b499fee5a9c992432213a18e9114c70bd9d4 (diff)
downloadfocaccia-3659d5cdc2ae42908fcae70ddb16af669027c344.tar.gz
focaccia-3659d5cdc2ae42908fcae70ddb16af669027c344.zip
Add better error handling for fpconvert_fp64
-rw-r--r--src/focaccia/miasm_util.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/focaccia/miasm_util.py b/src/focaccia/miasm_util.py
index 878683b..2cbcc52 100644
--- a/src/focaccia/miasm_util.py
+++ b/src/focaccia/miasm_util.py
@@ -93,11 +93,13 @@ def simp_fpconvert_fp64(expr_simp, expr: ExprOp):
     if expr.op != 'fpconvert_fp64':
         return expr
 
-    assert(len(expr.args) == 1)
+    if not len(expr.args) == 1:
+        raise NotImplementedError(f'fpconvert_fp64 on number of arguments not in 1: {expr.args}')
+
     operand = expr.args[0]
     if operand.is_int():
         if not operand.size == 32:
-            raise NotImplementedError('fpconvert_fp64 on values of size not in 64')
+            raise NotImplementedError(f'fpconvert_fp64 on values of size not in 64: {operand.size}')
 
         res = double_bits_to_uint(uint_bits_to_double(float_bits_to_uint(operand.arg)))
         return expr_simp(ExprInt(res, 64))