gossamer icon indicating copy to clipboard operation
gossamer copied to clipboard

Bug: all runtime offsets should be `uint32`

Open qdm12 opened this issue 2 years ago • 0 comments

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

qdm12 avatar Jul 22 '22 15:07 qdm12