public WebassemblyGlobal(BinaryReader reader) { valueType = Convert.ToInt32(Parser.ParseLEBSigned(reader, 7)); long mut = Parser.ParseLEBSigned(reader, 7); init = new WebassemblyExpression(reader); }
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)); }
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); }