WASM “if...else” doc: What happens if the value is not 0 or 1? (incomplete information) #20193
Labels
Content:wasm
WebAssembly docs
help wanted
If you know something about this topic, we would love your help!
MDN URL
https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Control_flow/if...else
What specific section or headline is this issue about?
The description
What information was incorrect, unhelpful, or incomplete?
It is not explained what happens if the value is not 0 or 1.
Often, null checks are practical, and in low level languages like C, it is ok to write
if(ptr) ...
Is this allowed in WASM, or undefined behavior?
What did you expect to see?
The answer that it is allowed.
To quote from the specs:
Section 4.4.8.5. of https://webassembly.github.io/spec/core/bikeshed/#control-instructions%E2%91%A4
Do you have any supporting links, references, or citations?
https://webassembly.github.io/spec/core/bikeshed/#control-instructions%E2%91%A4
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/webassembly/reference/control_flow/if...else
The text was updated successfully, but these errors were encountered: