Skip to content

Commit 106ca84

Browse files
committed
expr_simplifier: re-enable folding of typeconv into literal
1 parent da40bfa commit 106ca84

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

m2isar/metamodel/utils/expr_simplifier.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ def _(self, expr: behav.TypeConv, context):
230230
if isinstance(expr.expr, behav.IntLiteral):
231231
size = expr.size
232232
if size is None:
233-
return expr
234-
# assert expr.inferred_type is not None
235-
# size = expr.inferred_type.width
236-
# assert size is not None
233+
if expr.inferred_type is None:
234+
return expr
235+
size = expr.inferred_type.width
236+
assert size is not None
237237
expr.expr.bit_size = size
238238
assert expr.expr.bit_size is not None
239239
expr.expr.signed = expr.data_type == arch.DataType.S

0 commit comments

Comments
 (0)