Closed usamec closed 6 years ago
This code
#[macro_use] extern crate cpp; cpp!{{ #include <cstdio> #include <memory> using namespace std; class A { public: int x, y; A(): x(42), y(47) {} ~A() { } }; }} #[repr(C)] #[derive(Debug)] pub struct A { pub _bindgen_opaque_blob: [u32; 2usize], } fn main() { loop { let x = unsafe { cpp!([] -> A as "A" { return A(); }) }; unsafe { cpp!([x as "A"] { printf("%d\n", x.x); printf("%d\n", x.y); }) }; } }
Produces seqfault. However when destructor is not present code runs correctly without segfault.
I think this is the same issue as #18
This code
Produces seqfault. However when destructor is not present code runs correctly without segfault.