Esempio n. 1
0
        private bool Visit(DeclareLocalStatement stmt)
        {
            var value = stmt.Initializer == null ? new BitsValue(0, stmt.Local.BitSize) : Visit(stmt.Initializer);

            Locals.Add(stmt.Local.Name, value);

            return(false);
        }
Esempio n. 2
0
        private void Visit(DeclareLocalStatement stmt)
        {
            var local = IL.DeclareLocal(typeof(BitsValue), "local_" + stmt.Local.Name);

            Locals.Add(stmt.Local.Name, (local, stmt.Local.BitSize));

            if (stmt.Initializer != null)
            {
                Visit(stmt.Initializer);
                IL.Stloc(local);
            }
            else
            {
                IL.Ldloca(local);
                IL.Initobj(typeof(BitsValue));
            }
        }