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

Issue 1503423003: ubsan shift fixes (Closed)

Created:
5 years ago by caryclark
Modified:
5 years ago
Reviewers:
_cary, mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

ubsan shift fixes Use an inline function that does a normal shift. When built for the sanitizer, add casts so that the shift is unsigned. Also make a few fixes to do unsigned shifts or avoid the shift altogether; and add an argument spec to some macros. R=reed@google.com,mtklein@google.com BUG=skia:4633 Committed: https://skia.googlesource.com/skia/+/3127c99986dc932343aae5ccc575237d99c3aaec

Patch Set 1 #

Total comments: 4

Patch Set 2 : use macro instead #

Patch Set 3 : added conditional build; 64 bit support #

Patch Set 4 : fixed earlier mistakes #

Patch Set 5 : fix typo #

Total comments: 10

Patch Set 6 : address comments #

Patch Set 7 : add cast to work around win compiler #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -38 lines) Patch
M include/core/SkFixed.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M include/core/SkTypes.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M src/core/SkBitmapProcState_matrixProcs.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkEdge.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkEdge.cpp View 1 2 3 4 chunks +6 lines, -6 lines 0 comments Download
M src/core/SkFDot6.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M src/core/SkFloatBits.cpp View 1 4 chunks +4 lines, -4 lines 0 comments Download
M src/core/SkScan_AntiPath.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/core/SkScan_Antihair.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkScan_Path.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkUtils.cpp View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/effects/gradients/SkClampRange.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkGradientShaderPriv.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/images/SkImageDecoder_libico.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pathops/SkOpAngle.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/ports/SkFontMgr_android_parser.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/utils/SkDashPath.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/MathTest.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M tests/RandomTest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (9 generated)
_cary
shield your eyes
5 years ago (2015-12-08 18:22:51 UTC) #2
reed1
https://codereview.chromium.org/1503423003/diff/1/include/core/SkFixed.h File include/core/SkFixed.h (right): https://codereview.chromium.org/1503423003/diff/1/include/core/SkFixed.h#newcode91 include/core/SkFixed.h:91: SkTPin<int32_t>(((int64_t)numer * (1 << 16)) / denom, SK_MinS32, SK_MaxS32) ...
5 years ago (2015-12-08 18:29:04 UTC) #3
_cary
PTAL. This approach should introduce no new overhead. In a few places, slightly different but ...
5 years ago (2015-12-09 14:33:40 UTC) #4
reed1
nice clean fix -- given the absurd situation we find ourselves in w/ 2s compliment ...
5 years ago (2015-12-09 15:54:27 UTC) #6
mtklein
https://codereview.chromium.org/1503423003/diff/80001/gyp/libjpeg-turbo.gyp File gyp/libjpeg-turbo.gyp (right): https://codereview.chromium.org/1503423003/diff/80001/gyp/libjpeg-turbo.gyp#newcode45 gyp/libjpeg-turbo.gyp:45: 'ldflags!': [ '-fsanitize=<(skia_sanitizer)' ], Should be we can revert ...
5 years ago (2015-12-09 16:48:11 UTC) #7
caryclark
https://codereview.chromium.org/1503423003/diff/80001/gyp/libjpeg-turbo.gyp File gyp/libjpeg-turbo.gyp (right): https://codereview.chromium.org/1503423003/diff/80001/gyp/libjpeg-turbo.gyp#newcode45 gyp/libjpeg-turbo.gyp:45: 'ldflags!': [ '-fsanitize=<(skia_sanitizer)' ], On 2015/12/09 16:48:11, mtklein wrote: ...
5 years ago (2015-12-09 19:13:12 UTC) #8
mtklein
lgtm
5 years ago (2015-12-09 19:15:26 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1503423003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1503423003/100001
5 years ago (2015-12-09 19:16:11 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/4710) Build-Win-MSVC-x86_64-Debug-Trybot on ...
5 years ago (2015-12-09 19:19:31 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1503423003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1503423003/120001
5 years ago (2015-12-09 19:45:34 UTC) #15
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-09 19:58:44 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1503423003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1503423003/120001
5 years ago (2015-12-09 20:01:46 UTC) #20
commit-bot: I haz the power
5 years ago (2015-12-09 20:02:33 UTC) #22
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://skia.googlesource.com/skia/+/3127c99986dc932343aae5ccc575237d99c3aaec

Powered by Google App Engine
This is Rietveld 408576698