[WebAssembly] Fix lowering of varargs functions with non-legal fixed arguments.
authorDan Gohman <dan433584@gmail.com>
Tue, 26 Jun 2018 03:18:38 +0000 (03:18 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 26 Jun 2018 03:18:38 +0000 (03:18 +0000)
commit910ba33d0c78bc8866a1939b255f91a5b4cd8eaa
tree87db357901637f5c257c5f0ae515299f1ae34b06
parentc42ed4e3c407dd97b8dcab873950611e89e166fe
[WebAssembly] Fix lowering of varargs functions with non-legal fixed arguments.

CallLoweringInfo's NumFixedArgs field gives the number of fixed arguments
before legalization. The ISD::OutputArg "Outs" array holds legalized
arguments, so when indexing into it to find the non-fixed arguemn, we need
to use the number of arguments after legalization.

Fixes PR37934.

llvm-svn: 335576
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/test/CodeGen/WebAssembly/varargs.ll