-
Notifications
You must be signed in to change notification settings - Fork 98
Description
Currently the canonical ABI defines a "join" function to allow variants to be represented with a flat list of types to get lifted, currently only exposed as the parameters to functions imported by the wasm module. As-is I believe the current rules for validating these parameters are:
- The discriminant, an i32, must be in-bounds
- Used flat values must have zero'd upper bits if the upper bits are discarded for a particular case
- Unused flat values for a particular case are not validated
In implementing this I'm finding it somewhat nontrivial to perform the second bit of validation here, ensuring that the upper bits of each flat type is zero when accessed during lowering. I could elaborate further about that as well, but before getting into that it felt like there was a bit of a discrepancy between validating that unused upper bits are zero but not validating that unused values entirely are zero. Given that, would it perhaps be reasonable to stop validating that the upper bits are zero? Instead allowing arbitrary bit-patterns there? (and variants just use the bits needed for each case)