[llvm-bugs] [Bug 35385] WASM backend generates invalid wasm for undeclared imports

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 28 09:20:33 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35385

Dan Gohman <dan433584 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #6 from Dan Gohman <dan433584 at gmail.com> ---
This is now fixed in r319186. My option C turned out to be even easier than I
expected; there's no need for FixFunctionBitcasts to pass a 0 argument, because
that's an ABI detail handled in codegen. So this turned out to be a fairly
simple generalization of the existing wrapper logic.

FixFunctionBitcasts now handles all the obvious cases with bitcasting to or
from varargs. Complex cases which theoretically should work but don't should be
rare, but if anyone finds one in real world, please report it.

> ==== file1.c ====
> extern void underspecified();
> void callWithArgs() { underspecified(1,2,3); }

This is now handled through FixFunctionBitcasts; it generates code like this:

extern void underspecified();
void wrapper(int a, int b, int c) { underspecified(1, 2, 3); }
void callWithArgs() { wrapper(1,2,3); }

which is then codegen'd to valid wasm.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171128/8e50bb19/attachment.html>


More information about the llvm-bugs mailing list