agile functions (like let block_length = function SHA3_... -> ... | SHA3_... -> ... | ...) appear in loop conditions as i < ... block_length a ...)
wasm inlines small helper functions like that aggressively
the regular hoisting transformation, written for C, thinks that a switch in a loop condition cannot be compiled to C (correct), and also thinks that it's a problem to hoist it, because the loop condition needs to be evaluated on each loop iteration (we don't check whether the things that need to be hoisted contain the index...)
it shares a warning with the if-then-else node, which has the same problem, EXCEPT there's a workaround for the if-then-else
we end up with unclosed bindings in the loop test
The fix is to just be ok with it in the case of WASM.
What happens is:
let block_length = function SHA3_... -> ... | SHA3_... -> ... | ...
) appear in loop conditions asi < ... block_length a ...
)The fix is to just be ok with it in the case of WASM.