Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Issue 2002523002: Fix an UBSan error (signed overflow) in saturating addition and subtraction (Closed)

Created:
4 years, 7 months ago by kwiberg-webrtc
Modified:
4 years, 7 months ago
Reviewers:
tlegrand-webrtc
CC:
webrtc-reviews_webrtc.org, Andrew MacDonald, tterriberry_mozilla.com, audio-team_agora.io, peah-webrtc, minyue-webrtc, aluebs-webrtc, bjornv1
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fix an UBSan error (signed overflow) in saturating addition and subtraction Of course, functions called WebRtcSpl_AddSatW32 and WebRtcSpl_SubSatW32 are supposed to handle overflow gracefully, and they probably did. But since the overflow handling depended on undefined behavior, a sufficiently smart optimizing compiler would have realized that it could just ignore the possibility of overflow and omit all the overflow handling code, leaving only the unadorned addition or subtraction. Also, the new implementations, unlike the old ones, result in branch-free code (tested with clang 3.9 with -O2). BUG=chromium:601728 Committed: https://crrev.com/bca568bfc59f944335510762f47fe4414ea1273e Cr-Commit-Position: refs/heads/master@{#12846}

Patch Set 1 : #

Total comments: 8

Patch Set 2 : review suggestions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -50 lines) Patch
M webrtc/common_audio/signal_processing/include/spl_inl.h View 1 1 chunk +21 lines, -31 lines 0 comments Download
M webrtc/common_audio/signal_processing/signal_processing_unittest.cc View 1 2 chunks +21 lines, -19 lines 0 comments Download

Messages

Total messages: 17 (9 generated)
kwiberg-webrtc
I think I've finally found a CL where you may not object to my use ...
4 years, 7 months ago (2016-05-20 08:57:16 UTC) #3
tlegrand-webrtc
Enjoy, it's not gonna happen again. ;) A few nits, then LGTM. https://codereview.chromium.org/2002523002/diff/20001/webrtc/common_audio/signal_processing/include/spl_inl.h File webrtc/common_audio/signal_processing/include/spl_inl.h ...
4 years, 7 months ago (2016-05-20 11:07:14 UTC) #4
kwiberg-webrtc
New patch set posted. https://codereview.webrtc.org/2002523002/diff/20001/webrtc/common_audio/signal_processing/include/spl_inl.h File webrtc/common_audio/signal_processing/include/spl_inl.h (right): https://codereview.webrtc.org/2002523002/diff/20001/webrtc/common_audio/signal_processing/include/spl_inl.h#newcode39 webrtc/common_audio/signal_processing/include/spl_inl.h:39: // Do the addition in ...
4 years, 7 months ago (2016-05-23 08:30:04 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2002523002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2002523002/40001
4 years, 7 months ago (2016-05-23 08:30:22 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg on tryserver.webrtc (JOB_TIMED_OUT, no build URL)
4 years, 7 months ago (2016-05-23 10:30:50 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2002523002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2002523002/40001
4 years, 7 months ago (2016-05-23 10:49:26 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:40001)
4 years, 7 months ago (2016-05-23 11:07:07 UTC) #15
commit-bot: I haz the power
4 years, 7 months ago (2016-05-23 11:07:19 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/bca568bfc59f944335510762f47fe4414ea1273e
Cr-Commit-Position: refs/heads/master@{#12846}

Powered by Google App Engine
This is Rietveld 408576698