Open Janrupf opened 4 weeks ago
I have this same issue, it simply runs, then returns no output, no error message.
I think think assumption looks correct. Would you be able to send a PR to fix that line?
Currently on vacation, but sadly the fix isn't as simple as I thought (it can cause miscompilation in other cases if applied the way I suggested). I'll take a look when I'm home again
The following module fails to compile:
Running
wat2wasm
on this leads to an exit code if 1, but no proper error message. Debugging with GDB shows that the typechecker throws an error here: https://github.com/WebAssembly/wabt/blob/1edeaf2948b4afd711e50ba2007ee44503cd80fe/src/type-checker.cc#L814The problem is, that even though the
result
is now set to an error, no error message is printed, as thePeekType
function doesn't do so. This code is obviously not valid WASM (its missing alocal.get 0
in front ofref.is_null
), but I still would expect a proper error message.Example with `i32.add`
```wasm (module (func (param i32) (result i32) (i32.add) ) ) ``` Gives a proper error message: ``` simple.wat:3:10: error: type mismatch in i32.add, expected [i32, i32] but got [] (i32.add) ^^^^^^^ ```(NOTE: After looking at the at the following the
PeekType
call, I assume the condition should have beentype == Type::Any || !type.IsRef()
)