Skip to content

Commit fcc4937

Browse files
committed
fixed function that was causing segfaults
1 parent ce6b9f6 commit fcc4937

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ impl Type {
3535
unsafe { core::LLVMPointerType(elem.into(), 0 as c_uint) }.into()
3636
}
3737
/// Make a new structure type with the given types.
38-
pub fn new_struct<'a>(elems: &[&'a Type], packed: bool) -> &'a Type {
39-
unsafe { core::LLVMStructType(elems.as_ptr() as *mut LLVMTypeRef, elems.len() as c_uint, packed as c_int) }.into()
38+
pub fn new_struct<'a>(context:&'a Context, elems: &[&'a Type], packed: bool) -> &'a Type {
39+
unsafe { core::LLVMStructTypeInContext(context.into(), elems.as_ptr() as *mut LLVMTypeRef, elems.len() as c_uint, packed as c_int) }.into()
4040
}
4141
/// Returns true if the size of the type is known at compile-time.
4242
///

0 commit comments

Comments
 (0)