Closed
Description
The following test, originally written for #3678, results in a segfault because insufficient stack is allocated (at least it does on the branch I plan to land that fixes #3678).
// Test what happens when we link to the same function name with
// different types. This situation can easily arise when linking two
// crates that make use of the same C library, for example.
mod A {
pub struct TwoU32s {
one: u32, two: u32
}
extern {
pub fn rust_dbg_extern_return_TwoU32s() -> TwoU32s;
}
}
mod B {
pub struct TwoU32s {
one: u32, two: u32
}
extern {
pub fn rust_dbg_extern_return_TwoU32s() -> TwoU32s;
}
}
fn wrapper() {
}
fn main() {
unsafe {
let a = A::rust_dbg_extern_return_TwoU32s();
// println(fmt!("%?", a));
// assert_eq!(a.one, 10);
// assert_eq!(a.two, 20);
}
unsafe {
let b = B::rust_dbg_extern_return_TwoU32s();
// println(fmt!("%?", b));
// assert_eq!(b.one, 10);
// assert_eq!(b.two, 20);
}
}
Paging @pcwalton, maybe you could take a look (once the PR for #3678 lands?)