Пример #1
0
        protected BlockIns(ref WASMReader input, OPCode op)
            : base(op)
        {
            byte blockId = input.ReadByte();

            if (blockId == 0x40)
            {
                BlockType = typeof(void);
            }
            else if (WASMType.IsSupportedValueTypeId(blockId))
            {
                BlockType = WASMType.GetValueType(blockId);
            }
            else // This is an index to a function type.
            {
                input.Position--;
                FunctionTypeIndex = input.ReadIntLEB128();
            }
            Expression = input.ReadExpression(op == OPCode.If);
            if (Expression[^ 1].OP == OPCode.Else)
Пример #2
0
 public void Write(Type valueType) => Write(WASMType.GetValueTypeId(valueType));
Пример #3
0
 public Type ReadValueType() => WASMType.GetValueType(ReadByte());