소스 검색

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 개월 전
부모
커밋
1f7d8e4675
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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_) {