The WebAssembly linker now creates a dummy function at index 0 to prevent miscomparisons with the NULL pointer, see https://github.com/WebAssembly/binaryen/pull/658. Thanks to pcc for pointing out this problem!
LGTM, thanks for fixing that.
Actually, I'm getting lit test failures with this patch (the changed parts of function.ll and function-ext.ll). Does that reproduce for you?
Fix test failure
(now LGTM, FTR)