]> git.lizzy.rs Git - rust.git/commit
work around bug when calling c-stack-cdecl fns from outside crate
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 21 Oct 2011 19:14:01 +0000 (12:14 -0700)
committerBrian Anderson <banderson@mozilla.com>
Mon, 24 Oct 2011 23:06:17 +0000 (16:06 -0700)
commitfb48817ade1ad4b9b41315038518d8d84ff8e57c
treec414fffb15e24072554c2aed5fac28d01ad1e0bb
parent02d7a1e7818f5ff3f272fe6cba21f82ea543dc39
work around bug when calling c-stack-cdecl fns from outside crate

In the main test, I call the wrapper instead of the native fn, as intended.
I also added an xfail-test that exercises the broken code path.  Will
file a bug.

Description of the broken code path:

The code path is that when we look up the external identifier we go through
trans_external_path() ->  type_of_ty_param_kinds_and_ty() ->
type_of_fn_from_ty() -> type_of_fn(), and type_of_fn() adds a lot of external
parameters. Problem is, I guess, that we don't pass the native ABI (or even the
fact that it's a native function!), just the types and kinds of the parameters.
src/test/run-pass/invoke-external-native.rs [new file with mode: 0644]
src/test/stdtest/sys.rs