go-interpreter / wagon

wagon, a WebAssembly-based Go interpreter, for Go.
BSD 3-Clause "New" or "Revised" License
903 stars 148 forks source link

io.ReadFull should be used at ReadByte #188

Closed hajimehoshi closed 4 years ago

hajimehoshi commented 4 years ago

https://github.com/go-interpreter/wagon/blob/v0.6.0/wasm/read.go#L45

In theory, Read might return 0 bytes without errors. io.ReadFull should be used to ensure that 1 byte is read.