Skip to content

[bug][bindgen] ArrayShape read corrupts the reader #3893

@youyuanwu

Description

@youyuanwu

Summary

I am experimenting scraping c headers into winmd and use windows-bindgen to generate bindings from winmd here: youyuanwu/bnd. There is a discrepancy between metadata and bindgen for treating ArrayShape, which causes reader corruption and panic for reading elsewhere.

ArrayShape write in metadata crate writes 4 bytes:

buffer.write_compressed(1); // rank

While read in bindgen crate read 3 bytes:

ELEMENT_TYPE_ARRAY => {

#3892 attempted to fix this but there is further plan to change windows-bindgen crate, so it is not merged.

Crate manifest

Crate code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions