Skip to content

Commit 220b461

Browse files
committed
ASTI: add support for xf_addressof
1 parent 4615d21 commit 220b461

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

chb/invariants/XXprUtil.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,27 @@ def memory_variable_to_lval_expression(
389389
return astree.mk_vinfo_lval_expression(
390390
vinfo, astoffset, anonymous=anonymous)
391391

392+
elif offset.is_array_index_offset:
393+
offset = cast("VMemoryArrayIndexOffset", offset)
394+
index = offset.index_expression
395+
astindex = xxpr_to_ast_def_expr(
396+
index, xdata, iaddr, astree, anonymous=anonymous)
397+
suboffset = offset.offset
398+
399+
if suboffset.is_no_offset:
400+
astindexoffset = astree.mk_expr_index_offset(astindex)
401+
return astree.mk_vinfo_lval_expression(
402+
vinfo, astindexoffset, anonymous=anonymous)
403+
404+
if suboffset.is_field_offset:
405+
suboffset = cast("VMemoryOffsetFieldOffset", suboffset)
406+
astsuboffset = field_offset_to_ast_offset(
407+
suboffset, xdata, iaddr, astree)
408+
astindexoffset = astree.mk_expr_index_offset(
409+
astindex, offset = astsuboffset)
410+
return astree.mk_vinfo_lval_expression(
411+
vinfo,astindexoffset, anonymous=anonymous)
412+
392413
chklogger.logger.error(
393414
"AST conversion of memory variable %s with other offset not yet "
394415
+ "supported at address %s",

0 commit comments

Comments
 (0)