Skip to content

Commit ccc1da2

Browse files
committed
Prevent stack overflow.
1 parent 2aa1c23 commit ccc1da2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_mir_dataflow/src/value_analysis.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use std::fmt::{Debug, Formatter};
3737
use std::ops::Range;
3838

3939
use rustc_data_structures::fx::FxHashMap;
40+
use rustc_data_structures::stack::ensure_sufficient_stack;
4041
use rustc_index::bit_set::BitSet;
4142
use rustc_index::{IndexSlice, IndexVec};
4243
use rustc_middle::mir::visit::{MutatingUseContext, PlaceContext, Visitor};
@@ -774,7 +775,7 @@ impl Map {
774775
// We manually iterate instead of using `children` as we need to mutate `self`.
775776
let mut next_child = self.places[root].first_child;
776777
while let Some(child) = next_child {
777-
self.cache_preorder_invoke(child);
778+
ensure_sufficient_stack(|| self.cache_preorder_invoke(child));
778779
next_child = self.places[child].next_sibling;
779780
}
780781

0 commit comments

Comments
 (0)