Exemplo n.º 1
0
        public WebassemblyGlobal(BinaryReader reader)
        {
            valueType = Convert.ToInt32(Parser.ParseLEBSigned(reader, 7));
            long mut = Parser.ParseLEBSigned(reader, 7);

            init = new WebassemblyExpression(reader);
        }
Exemplo n.º 2
0
        public WebassemblyDataInit(BinaryReader reader)
        {
            index = Parser.ParseLEBSigned(reader, 32);
            // assert table index is 0, only one allowed in this version
            if (index != 0)
            {
                throw new Exception("At most one memory allowed in this version of webassembly");
            }

            expr = new WebassemblyExpression(reader);

            long body_size = Parser.ParseLEBSigned(reader, 32);

            body = reader.ReadBytes(Convert.ToInt32(body_size));
        }
Exemplo n.º 3
0
        public WebassemblyFunc(BinaryReader reader)
        {
            int num_locals = Convert.ToInt32(Parser.ParseLEBSigned(reader, 32));

            this.locals = new WebassemblyLocal [num_locals];
            for (int local = 0; local < num_locals; local++)
            {
                // Size of local in count of 32-bit segments
                int size_of_local = Convert.ToInt32(Parser.ParseLEBSigned(reader, 7));
                int valueTypeInit = Convert.ToInt32(Parser.ParseLEBSigned(reader, 7));
                this.locals [local] = new WebassemblyLocal(size_of_local, valueTypeInit);
            }
            Console.WriteLine("Parsed code section one {0} locals", num_locals);
            this.expr = new WebassemblyExpression(reader, true);
        }