Abort creating wrapper fn for multiple inner fns
This discovers another class of mis-trans where we wrap multiple native functions into a single wrapper, which is wrong.
This commit is contained in:
parent
2198969f89
commit
baa52caf83
1 changed files with 5 additions and 0 deletions
|
|
@ -642,6 +642,11 @@ pub fn trans_rust_fn_with_foreign_abi<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
|
|||
// return r;
|
||||
// }
|
||||
|
||||
if llvm::LLVMCountBasicBlocks(llwrapfn) != 0 {
|
||||
ccx.sess().bug("wrapping a function inside non-empty wrapper, most likely cause is \
|
||||
multiple functions being wrapped");
|
||||
}
|
||||
|
||||
let ptr = "the block\0".as_ptr();
|
||||
let the_block = llvm::LLVMAppendBasicBlockInContext(ccx.llcx(), llwrapfn,
|
||||
ptr as *const _);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue