<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 16, 2016 at 4:41 PM, Dan Gohman <span dir="ltr"><<a href="mailto:sunfish@mozilla.com" target="_blank">sunfish@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Sep 16, 2016 at 3:04 PM, Derek Schuff <span dir="ltr"><<a href="mailto:dschuff@google.com" target="_blank">dschuff@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div><div>Which you could simplify to</div><div><div>(module</div><div>  (func $minimal_loop (param $0 i32) (result i32)</div><div>    (block $label$1</div><div>      (loop $label$0</div><div>        (br $label$0)</div><div>      )</div><div>    )</div><div>  )</div><div>)</div></div><div><br></div><div>Which is a type check failure because the loop/block structure yields/pushes no value but the function expects an i32 return. </div></div></blockquote><div><br></div></span><div>This is actually a valid WebAssembly program :-). One of the main branches of the reference interpreter currently issues an error here, but it's a bug: the intention is that because the `br` makes code after it unreachable, so there doesn't need to be a return value after it.<span class="HOEnZb"><font color="#888888"><br></font></span></div></div></div></div></blockquote><div><br></div><div>Actually, I misspoke. This is the situation where consumers are not required to type-check, but they may type-check, so producers have to follow a complex set of rules just in case. I think what we should do here is add type signatures to `block` and `loop`, to mirror the 0xc change, and then make LLVM add an `i32` return type to the `loop` and `block` here.<br><br></div><div>Dan<br><br></div></div></div></div>