Skip to content

Commit a262ec8

Browse files
committed
Tweak bounds check in DepNodeColorMap.get
1 parent f66622c commit a262ec8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • compiler/rustc_middle/src/dep_graph

compiler/rustc_middle/src/dep_graph/graph.rs

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

0 commit comments

Comments
 (0)