Skip to content

Commit 49b2c82

Browse files
committed
Auto merge of #151540 - Zoxc:color-get-opt, r=<try>
Tweak bounds check in `DepNodeColorMap.get`
2 parents 5944b12 + 58dd2e5 commit 49b2c82

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • compiler/rustc_query_system/src/dep_graph

compiler/rustc_query_system/src/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ impl DepNodeColorMap {
13961396
let value = self.values[index].load(Ordering::Acquire);
13971397
// Green is by far the most common case. Check for that first so we can succeed with a
13981398
// single comparison.
1399-
if value < COMPRESSED_RED {
1399+
if value <= DepNodeIndex::MAX_AS_U32 {
14001400
DepNodeColor::Green(DepNodeIndex::from_u32(value))
14011401
} else if value == COMPRESSED_RED {
14021402
DepNodeColor::Red

0 commit comments

Comments
 (0)