Skip to content

Commit a861023

Browse files
authored
Rollup merge of #108739 - 823984418:patch-1, r=cjgillot
Prevent the `start_bx` basic block in codegen from having two `Builder`s at the same time Here, at the same time, there are two `start_llbb` builder, this should be unexpected.
2 parents 5c5f6d0 + 871b4fe commit a861023

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+4
-0
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
258258
// Apply debuginfo to the newly allocated locals.
259259
fx.debug_introduce_locals(&mut start_bx);
260260

261+
// The builders will be created separately for each basic block at `codegen_block`.
262+
// So drop the builder of `start_llbb` to avoid having two at the same time.
263+
drop(start_bx);
264+
261265
// Codegen the body of each block using reverse postorder
262266
for (bb, _) in traversal::reverse_postorder(&mir) {
263267
fx.codegen_block(bb);

0 commit comments

Comments
 (0)