[PR #1393] [MERGED] Fix one-off in dcheck. #2003

Open
opened 2026-01-29 20:56:53 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/1393
Author: @copybara-service[bot]
Created: 11/21/2025
Status: Merged
Merged: 11/24/2025
Merged by: @copybara-service[bot]

Base: masterHead: test_835164941


📝 Commits (1)

📊 Changes

8 files changed (+9 additions, -9 deletions)

View changed files

📝 c/enc/backward_references_hq.c (+1 -1)
📝 c/enc/hash.h (+2 -2)
📝 c/enc/hash_forgetful_chain_inc.h (+1 -1)
📝 c/enc/hash_longest_match64_inc.h (+1 -1)
📝 c/enc/hash_longest_match64_simd_inc.h (+1 -1)
📝 c/enc/hash_longest_match_inc.h (+1 -1)
📝 c/enc/hash_longest_match_quickly_inc.h (+1 -1)
📝 c/enc/hash_longest_match_simd_inc.h (+1 -1)

📄 Description

Fix one-off in dcheck.

How to prove correctness:

  1. when position is 0, max_length is allowed to be ringbuffer_size
  2. in other words: position + max_length <= ringbuffer_size
  3. ringbuffer_mask == ringbuffer_size - 1
  4. thus position + max_length <= ringbuffer_size + 1

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/1393 **Author:** [@copybara-service[bot]](https://github.com/apps/copybara-service) **Created:** 11/21/2025 **Status:** ✅ Merged **Merged:** 11/24/2025 **Merged by:** [@copybara-service[bot]](https://github.com/apps/copybara-service) **Base:** `master` ← **Head:** `test_835164941` --- ### 📝 Commits (1) - [`486ed5b`](https://github.com/google/brotli/commit/486ed5bc56012c13e24bde76ad1fdd9496ebca3f) Fix one-off in dcheck. ### 📊 Changes **8 files changed** (+9 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `c/enc/backward_references_hq.c` (+1 -1) 📝 `c/enc/hash.h` (+2 -2) 📝 `c/enc/hash_forgetful_chain_inc.h` (+1 -1) 📝 `c/enc/hash_longest_match64_inc.h` (+1 -1) 📝 `c/enc/hash_longest_match64_simd_inc.h` (+1 -1) 📝 `c/enc/hash_longest_match_inc.h` (+1 -1) 📝 `c/enc/hash_longest_match_quickly_inc.h` (+1 -1) 📝 `c/enc/hash_longest_match_simd_inc.h` (+1 -1) </details> ### 📄 Description Fix one-off in dcheck. How to prove correctness: 1) when `position` is `0`, `max_length` is allowed to be `ringbuffer_size` 2) in other words: `position + max_length <= ringbuffer_size` 3) `ringbuffer_mask == ringbuffer_size - 1` 4) thus `position + max_length <= ringbuffer_size + 1` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:56:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#2003