Ejemplo n.º 1
0
        public bool Equals(ImmutableVariableStorage other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            var dictionaryComparer = new ImmutableDictionaryComparer <string, Variable>();

            return(dictionaryComparer.Equals(SuperGlobals, other.SuperGlobals) &&
                   dictionaryComparer.Equals(Globals, other.Globals) &&
                   dictionaryComparer.Equals(Locals, other.Locals) &&
                   dictionaryComparer.Equals(ClassVariables, other.ClassVariables) &&
                   dictionaryComparer.Equals(LocalAccessibleGlobals, other.LocalAccessibleGlobals));

            return(SuperGlobals.OrderBy(x => x.Key).SequenceEqual(other.SuperGlobals.OrderBy(x => x.Key)) &&
                   Globals.OrderBy(x => x.Key).SequenceEqual(other.Globals.OrderBy(x => x.Key)) &&
                   Locals.OrderBy(x => x.Key).SequenceEqual(other.Locals.OrderBy(x => x.Key)) &&
                   ClassVariables.OrderBy(x => x.Key).SequenceEqual(other.ClassVariables.OrderBy(x => x.Key)) &&
                   LocalAccessibleGlobals.OrderBy(x => x.Key).SequenceEqual(other.LocalAccessibleGlobals.OrderBy(x => x.Key)));

            return(SuperGlobals.SequenceEqual(other.SuperGlobals) &&
                   Globals.SequenceEqual(other.Globals) &&
                   Locals.SequenceEqual(other.Locals) &&
                   ClassVariables.SequenceEqual(other.ClassVariables) &&
                   LocalAccessibleGlobals.SequenceEqual(other.LocalAccessibleGlobals));
        }
Ejemplo n.º 2
0
        public bool Equals(CFGTaintInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            // todo: Check taint set too
            var comparer = new ImmutableDictionaryComparer <EdgeType, ImmutableVariableStorage>();

            return(In.Equals(other.In) && comparer.Equals(Out, other.Out));
        }