Skip to content

add DCHECK bounds checks to operator[]#627

Open
jmestwa-coder wants to merge 1 commit intogoogle:mainfrom
jmestwa-coder:podarray-dcheck-bounds
Open

add DCHECK bounds checks to operator[]#627
jmestwa-coder wants to merge 1 commit intogoogle:mainfrom
jmestwa-coder:podarray-dcheck-bounds

Conversation

@jmestwa-coder
Copy link
Copy Markdown

Summary

Add debug-only bounds checks to PODArray::operator[].

Change

  • Add ABSL_DCHECK_GE(pos, 0) and ABSL_DCHECK_LT(pos, size())

Why

Helps catch out-of-bounds access during development and testing,
especially since PODArray is widely used across the codebase.

Impact

  • No effect in release builds
  • Improves debugging safety without changing behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant