public void VpMkSequenceToAddress() { Constant seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711); Constant off = Constant.Word16(0x4111); arch.Expect(a => a.MakeSegmentedAddress(seg, off)).Return(Address.SegPtr(0x4711, 0x4111)); mr.ReplayAll(); Expression e = new MkSequence(PrimitiveType.Word32, seg, off); var vp = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds)); e = e.Accept(vp); Assert.IsInstanceOf(typeof(Address), e); Assert.AreEqual("4711:4111", e.ToString()); mr.VerifyAll(); }
public void VisitMkSequence(MkSequence seq) { writer.Write("SEQ("); WriteExpression(seq.Head); writer.Write(", "); WriteExpression(seq.Tail); writer.Write(")"); }
public void VpSequenceOfConstants() { Constant pre = Constant.Word16(0x0001); Constant fix = Constant.Word16(0x0002); Expression e = new MkSequence(PrimitiveType.Word32, pre, fix); var vp = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds)); e = e.Accept(vp); Assert.AreEqual("0x00010002", e.ToString()); }
public void VisitMkSequence(MkSequence seq) { throw new NotImplementedException(); }
public void VpMkSequenceToAddress() { Constant seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711); Constant off = Constant.Word16(0x4111); Expression e = new MkSequence(PrimitiveType.Word32, seg, off); var vp = new ExpressionSimplifier(new SsaEvaluationContext(ssaIds)); e = e.Accept(vp); Assert.IsInstanceOf(typeof(Address), e); Assert.AreEqual("4711:4111", e.ToString()); }
public void VisitMkSequence(MkSequence seq) { VisitBinaryExpression(Operator.IAdd, seq.DataType, seq.Head, seq.Tail); }
public override void VisitMkSequence(MkSequence seq) { seq.Head.Accept(this); seq.Tail.Accept(this); EnsureTypeVariable(seq); }
public Expression VisitMkSequence(MkSequence seq) { var newSeq = seq.Expressions.Select(e => e.Accept(this)).ToArray(); return(new MkSequence(seq.DataType, newSeq)); }
public override Expression VisitMkSequence(MkSequence seq) { var head = seq.Head.Accept(this); var tail = seq.Tail.Accept(this); Constant c = seq.Tail as Constant; var ptHead = head.TypeVariable.DataType as PrimitiveType; if (head.TypeVariable.DataType is Pointer || (ptHead != null && ptHead.Domain == Domain.Selector)) { if (c != null) { ComplexExpressionBuilder ceb = new ComplexExpressionBuilder( seq.TypeVariable.DataType, head.TypeVariable.DataType, head.TypeVariable.OriginalDataType, null, head, null, StructureField.ToOffset(c)); return ceb.BuildComplex(); } else { var ceb = new ComplexExpressionBuilder( seq.TypeVariable.DataType, seq.TypeVariable.DataType, seq.TypeVariable.OriginalDataType, head, new MemberPointerSelector(seq.DataType, head, tail), null, 0); return ceb.BuildComplex(); } } else { } return new MkSequence(seq.DataType, head, tail); }
void IExpressionVisitor.VisitMkSequence(MkSequence seq) { Method("Seq"); WriteExpressions(seq.Expressions); writer.Write(")"); }
void IExpressionVisitor.VisitMkSequence(MkSequence seq) { throw new NotImplementedException(); }
public bool VisitMkSequence(MkSequence seq) { var dead = seq.Expressions.All(e => e.Accept(this)); return(dead); }
public override Expression VisitMkSequence(MkSequence seq) { var head = Rewrite(seq.Head, false); var tail = Rewrite(seq.Tail, false); Constant c = seq.Tail as Constant; var ptHead = DataTypeOf(head) as PrimitiveType; if (head.TypeVariable.DataType is Pointer || (ptHead != null && ptHead.Domain == Domain.Selector)) { if (c != null) { return RewriteComplexExpression(head, null, c.ToInt32(), dereferenced); } else { var oldBase = this.basePtr; this.basePtr = head; Expression exp = RewriteComplexExpression( tail, null, 0, dereferenced); this.basePtr = oldBase; return exp; } } else { } return new MkSequence(seq.DataType, head, tail); }
public virtual void VisitMkSequence(MkSequence seq) { seq.Head.Accept(this); seq.Tail.Accept(this); }
public Expression Transform(Expression baseptr, DataType dtAccess) { if (baseptr != null) { ArrayPointer = new MkSequence(dtPointer, baseptr, ArrayPointer); } return new ArrayAccess( dtAccess, ArrayPointer, new BinaryExpression( BinaryOperator.IMul, Index.DataType, Index, ElementSize)); }
public BitRange VisitMkSequence(MkSequence seq) { return(seq.Expressions.Aggregate( BitRange.Empty, (range, e) => range | e.Accept(this))); }
public bool VisitMkSequence(MkSequence seq) => seq.Expressions.Any(e => e.Accept(this));