I found this error condition was untested in wabt so I added test here: https://github.com/WebAssembly/wabt/pull/1775 Presumably it would be good idea to upstream such tests here? We also have another test for when a function doesn't report the correct body size (https://github.com/WebAssembly/wabt/blob/main/test/binary/bad-function-body-size.txt).