Browse Source

Fix ValueStore::GetRawIndex DCHECK to use id.index in diagnostic (#6975)

## Summary

`ValueStore::GetRawIndex` formatted the first `CARBON_DCHECK` with
`index` before the local `index` is declared. Use `id.index` so the
diagnostic matches the condition being checked.

## Test plan

- `bazelisk build //toolchain/base:base` (or `//toolchain/...` as
appropriate)
cui 1 month ago
parent
commit
1f7d8e4675
1 changed files with 1 additions and 1 deletions
  1. 1 1
      toolchain/base/value_store.h

+ 1 - 1
toolchain/base/value_store.h

@@ -232,7 +232,7 @@ class ValueStore
 
   auto GetIdTag() const -> IdTagType { return tag_; }
   auto GetRawIndex(IdT id) const -> int32_t {
-    CARBON_DCHECK(id.index >= 0, "{0}", index);
+    CARBON_DCHECK(id.index >= 0, "{0}", id.index);
     auto index = tag_.Remove(id);
 #ifndef NDEBUG
     if (index >= size_) {