Avoid unnecessary cast on a garbage data.
authorIvan Krasin <krasin@google.com>
Sat, 19 Nov 2016 02:28:30 +0000 (18:28 -0800)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Sat, 19 Nov 2016 06:47:34 +0000 (06:47 +0000)
It's dangerous and rightfully makes Control Flow Integrity check unhappy.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5074

Change-Id: Ie59490a5c671240128a9fcb353108f67f32d2f9e
Reviewed-on: https://skia-review.googlesource.com/5074
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

src/core/SkFixedAlloc.h

index 8d55cc7222e3558b1c798d5a414a25a39a4cc69b..cbf5ac25d447777d8fbe91f07ba640c823933e0c 100644 (file)
@@ -36,7 +36,7 @@ public:
         fUsed += skip;
 
         // Make space for T.
-        auto ptr = (T*)(fBuffer+fUsed);
+        void* ptr = fBuffer+fUsed;
         fUsed += sizeof(T);
 
         // Stamp a footer after the T that we can use to clean it up.