Fix ASAN errors.
authorbenjaminwagner <benjaminwagner@google.com>
Wed, 4 May 2016 18:06:19 +0000 (11:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 4 May 2016 18:06:19 +0000 (11:06 -0700)
These errors occur when building for GPU but running dm with --nogpu. The current ASAN bots do not catch these because 1) the CPU bot compiles with skia_gpu=0 and 2) the GPU bot runs with --nocpu; whereas the new ASAN bots use the same compile for both the CPU and GPU bots.

BUG=skia:5157
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953473002

Review-Url: https://codereview.chromium.org/1953473002

src/gpu/GrShape.cpp
src/gpu/GrStyle.h

index bb9c186..3b49f6a 100644 (file)
@@ -32,8 +32,8 @@ GrShape& GrShape::operator=(const GrShape& that) {
             break;
     }
     fInheritedKey.reset(that.fInheritedKey.count());
-    memcpy(fInheritedKey.get(), that.fInheritedKey.get(),
-           sizeof(uint32_t) * fInheritedKey.count());
+    sk_careful_memcpy(fInheritedKey.get(), that.fInheritedKey.get(),
+                      sizeof(uint32_t) * fInheritedKey.count());
     return *this;
 }
 
index 3ed4448..d63df32 100644 (file)
@@ -159,8 +159,8 @@ private:
             fType = that.fType;
             fPhase = that.fPhase;
             fIntervals.reset(that.fIntervals.count());
-            memcpy(fIntervals.get(), that.fIntervals.get(),
-                   sizeof(SkScalar) * that.fIntervals.count());
+            sk_careful_memcpy(fIntervals.get(), that.fIntervals.get(),
+                              sizeof(SkScalar) * that.fIntervals.count());
             return *this;
         }
         void reset() {