Esempio n. 1
0
                private FList <Variable> AddVariablesForsArrayLengths(APC pc, FList <Variable> variables)
                {
                    Contract.Ensures(variables == null || Contract.Result <FList <Variable> >() != null);

                    if (variables == FList <Variable> .Empty)
                    {
                        return(variables);
                    }

                    var postPC       = pc.Post();
                    var arrayLenghts = FList <Variable> .Empty;

                    foreach (var v in variables.GetEnumerable())
                    {
                        Variable vLength;
                        if (this.mDriver.Context.ValueContext.TryGetArrayLength(postPC, v, out vLength))
                        {
                            arrayLenghts = arrayLenghts.Cons(vLength);
                        }
                    }

                    if (!arrayLenghts.IsEmpty())
                    {
                        variables = variables.Append(arrayLenghts);
                        Contract.Assert(variables != null);
                    }

                    return(variables);
                }