trans: don't create allocas anywhere other than the entry block.
This commit is contained in:
parent
11e31091a9
commit
02cbc0ef8c
1 changed files with 5 additions and 2 deletions
|
@ -894,8 +894,11 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
|
||||||
// bitcasting to the struct type yields invalid cast errors.
|
// bitcasting to the struct type yields invalid cast errors.
|
||||||
|
|
||||||
// We instead thus allocate some scratch space...
|
// We instead thus allocate some scratch space...
|
||||||
let llscratch = bcx.alloca(llcast_ty, "fn_ret_cast");
|
let llscratch = bcx.with_block(|bcx| {
|
||||||
bcx.with_block(|bcx| base::call_lifetime_start(bcx, llscratch));
|
let alloca = base::alloca(bcx, llcast_ty, "fn_ret_cast");
|
||||||
|
base::call_lifetime_start(bcx, alloca);
|
||||||
|
alloca
|
||||||
|
});
|
||||||
|
|
||||||
// ...where we first store the value...
|
// ...where we first store the value...
|
||||||
bcx.store(op.immediate(), llscratch);
|
bcx.store(op.immediate(), llscratch);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue