<div dir="ltr">Yeah, that sounds right. I think Alon is in the middle (beginning?) of bringing Binaryen up to the rest of 0xc, so I'll see where he is on Monday. Meanwhile I can do some things on the LLVM side.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 16, 2016 at 5:04 PM Dan Gohman <<a href="mailto:sunfish@mozilla.com">sunfish@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Fri, Sep 16, 2016 at 4:41 PM, Dan Gohman <span dir="ltr" class="gmail_msg"><<a href="mailto:sunfish@mozilla.com" class="gmail_msg" target="_blank">sunfish@mozilla.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><span class="gmail_msg">On Fri, Sep 16, 2016 at 3:04 PM, Derek Schuff <span dir="ltr" class="gmail_msg"><<a href="mailto:dschuff@google.com" class="gmail_msg" target="_blank">dschuff@google.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Which you could simplify to</div><div class="gmail_msg"><div class="gmail_msg">(module</div><div class="gmail_msg">  (func $minimal_loop (param $0 i32) (result i32)</div><div class="gmail_msg">    (block $label$1</div><div class="gmail_msg">      (loop $label$0</div><div class="gmail_msg">        (br $label$0)</div><div class="gmail_msg">      )</div><div class="gmail_msg">    )</div><div class="gmail_msg">  )</div><div class="gmail_msg">)</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div></span><div class="gmail_msg">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="m_5174797185194655223HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><br class="gmail_msg"></font></span></div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">Dan<br class="gmail_msg"><br class="gmail_msg"></div></div></div></div></blockquote></div>