gossamer
gossamer copied to clipboard
Bug: all runtime offsets should be `uint32`
We need to change all int32
to uint32
for offsets (aka pointers) and data length in lib/runtime/imports.go
and lib/runtime/common.go
.
Due to the use of two-complement it is hardly an issue in most computation, which is also the reason why wasm does not differentiate them in their instructions set (int32 and uint32). Of course, if your coding language support differentiation, use the appropriate type for it. I.e. an offset should be unsigned.
We might also want to add unit tests testing inputs larger than the max of int32