diff options
author | Herb Derby <herb@google.com> | 2017-08-11 14:00:50 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-11 19:23:06 +0000 |
commit | 35ae65d5d04dc3fc75a635c90c5aa9bb1eda3812 (patch) | |
tree | 185d330eee186be755e9f32ae67cddc7b055783d /gn | |
parent | 4a31c46006d297b6230a72d1f7bbadb0ca6df429 (diff) |
SkSafeMath for tracking size_t overflow
Do multiply (mul) and add while tracking that the
calculation does not overflow, which can be checked with
ok().
The new unit test shows a couple examples.
Author: Herb Derby <herb@google.com>
Change-Id: I7e67671d2488d67f21d47d9618736a6bae8f23c3
Reviewed-on: https://skia-review.googlesource.com/33721
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'gn')
-rw-r--r-- | gn/tests.gni | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gn/tests.gni b/gn/tests.gni index 26bdc94745..c2f3759cd2 100644 --- a/gn/tests.gni +++ b/gn/tests.gni @@ -191,6 +191,7 @@ tests_sources = [ "$_tests/RoundRectTest.cpp", "$_tests/RRectInPathTest.cpp", "$_tests/RTreeTest.cpp", + "$_tests/SafeMathTest.cpp", "$_tests/ScalarTest.cpp", "$_tests/ScaleToSidesTest.cpp", "$_tests/SerializationTest.cpp", |