Skip to content

Commit

Permalink
pw_multisink: Ignore unsigned negation sanitizer warnings
Browse files Browse the repository at this point in the history
Fix: 380089512
Change-Id: I5949442ef3753843fc9ed09998edbe548eece0ed
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/250353
Reviewed-by: Carlos Chinchilla <[email protected]>
Docs-Not-Needed: Dave Roth <[email protected]>
Lint: Lint 🤖 <[email protected]>
Pigweed-Auto-Submit: Dave Roth <[email protected]>
Presubmit-Verified: CQ Bot Account <[email protected]>
Commit-Queue: Dave Roth <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
  • Loading branch information
davexroth authored and CQ Bot Account committed Nov 20, 2024
1 parent a2a859e commit 8a568e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pw_multisink/multisink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Result<ConstByteSpan> MultiSink::PeekOrPopEntry(
if (peek_status.IsOutOfRange()) {
// If the drain has caught up, report the last handled sequence ID so that
// it can still process any dropped entries.
// Negation overflow is by design.
/// -fsanitize-undefined-ignore-overflow-pattern=negated-unsigned-const
entry_sequence_id_out = sequence_id_ - 1;
} else if (!peek_status.ok()) {
// Discard the entry if the result isn't OK or OUT_OF_RANGE and exit, as the
Expand Down Expand Up @@ -153,6 +155,8 @@ void MultiSink::AttachDrain(Drain& drain) {

PW_CHECK_OK(ring_buffer_.AttachReader(drain.reader_));
if (&drain == &oldest_entry_drain_) {
// Negation overflow is by design.
/// -fsanitize-undefined-ignore-overflow-pattern=negated-unsigned-const
drain.last_handled_sequence_id_ = sequence_id_ - 1;
} else {
drain.last_handled_sequence_id_ =
Expand Down

0 comments on commit 8a568e4

Please sign in to comment.