Skip to content

Commit f5f562f

Browse files
marcrobmmarc
andauthored
Handle transformation of nested GEPExpr within index (#922)
Co-authored-by: marc <[email protected]>
1 parent 0946efb commit f5f562f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dartagnan/src/main/java/com/dat3m/dartagnan/program/processing/GEPToAddition.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ public Expression visitGEPExpression(GEPExpr gep) {
7272
Type indexingType = gep.getIndexingType();
7373

7474
final int baseSize = baseStride != null ? baseStride : types.getMemorySizeInBytes(indexingType);
75-
Expression totalOffset = expressions.makeMul(expressions.makeValue(baseSize, offsetType), indices.get(0));
75+
Expression totalOffset = expressions.makeMul(expressions.makeValue(baseSize, offsetType), indices.get(0).accept(this));
7676

7777
for (Expression index : indices.subList(1, indices.size())) {
78+
index = index.accept(this);
7879
Expression offset;
7980
if (indexingType instanceof AggregateType aggType && index instanceof IntLiteral lit) {
8081
final int intIndex = lit.getValueAsInt();

0 commit comments

Comments
 (0)