Skip to content

Commit

Permalink
Merge branch 'fix-slice-mem-rule' of https://github.com/ptomin/reko i…
Browse files Browse the repository at this point in the history
…nto ptomin-fix-slice-mem-rule
  • Loading branch information
uxmal committed Jan 15, 2024
2 parents 454d053 + 5f72fdc commit 331c6ba
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/UnitTests/Decompiler/Evaluation/ExpressionSimplifierTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,5 +1314,18 @@ public void Exs_Eq_false()

Assert.AreEqual("!c_3", exp.ToString());
}

[Test]
public void Exs_SliceMemPtrIdPlusIntConst()
{
Given_ExpressionSimplifier();
var id = Given_Tmp("id", PrimitiveType.Ptr32);
Expression exp = m.Slice(
m.Mem(PrimitiveType.Word64, m.IAdd(id, m.Word32(1))),
PrimitiveType.Word32, 8);
exp = RunExpressionSimplifier(exp);

Assert.AreEqual("Mem0[id_3 + 2<32>:word32]", exp.ToString());
}
}
}

0 comments on commit 331c6ba

Please sign in to comment.