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:
If c is non-zero, then Execute the block instruction instr_1
Else Execute the block instruction instr_2
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
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