fn read_instructions(
    wasm: &mut WasmReader<'_>,
    stack: &mut ValidationStack,
    sidetable: &mut Vec<SidetableEntry>,
    locals: &[ValType],
    globals: &[Global],
    fn_types: &[FuncType],
    type_idx_of_fn: &[usize],
    memories: &[MemType],
    data_count: &Option<u32>,
    tables: &[TableType],
    elements: &[ElemType],
    referenced_functions: &BTreeSet<u32>
) -> Result<()>