-
Notifications
You must be signed in to change notification settings - Fork 30
Description
When I define a WIT record that includes u64 fields and try to access those fields from python I get OverflowErrors out of the componentize_py_to_canon_i64 function in the runtime. I believe that's happening because u64 and s64 are conflated in several places including https://github.com/bytecodealliance/componentize-py/blob/main/src/bindgen.rs#L602
Naively changing the return type of that function to u64 fixes the issue for me because I am exclusively using u64s but I assume it would break code that was using signed values. If I'm understanding things correctly then the real solution would be to create a new componentize-py#ToCanonU64 which returns u64 in the rust layer and is defined as returning NumType::I64 in IMPORT_SIGNATURES since wasm's internal i64 type seems to be used for both signed and unsigned data. If that sounds correct to you, I'm happy to write up a PR with the change.