From 50b83525e1deb02310cd02a505d65b9e40e1f399 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 29 Nov 2022 22:31:12 -0800 Subject: [PATCH] Analogous bugfix at another site. --- src/frontend.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/frontend.rs b/src/frontend.rs index cf5b02f..1d5a398 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -460,10 +460,14 @@ impl LocalTracker { let placeholder = body.add_placeholder(ty); body.mark_value_as_local(placeholder, local); - self.block_end - .entry(at_block) - .or_insert_with(|| FxHashMap::default()) - .insert(local, placeholder); + if at_block == self.cur_block { + self.in_cur_block.insert(local, placeholder); + } else { + self.block_end + .get_mut(&at_block) + .unwrap() + .insert(local, placeholder); + } log::trace!( " -> created placeholder and added as incomplete phi: {:?}", placeholder