make u32 check runtime

Bug: 848521
Change-Id: Id3deb30447cc5caa27203b46b6b257e76cd88679
Reviewed-on: https://skia-review.googlesource.com/140986
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This commit is contained in:
Mike Reed 2018-07-13 16:13:08 -04:00 committed by Skia Commit-Bot
parent a80a012456
commit 1128ebcb6d

View File

@ -134,7 +134,9 @@ public:
private:
static void AssertRelease(bool cond) { if (!cond) { ::abort(); } }
static uint32_t ToU32(size_t v) {
assert(v <= 0xffffffff);
#if SIZE_MAX > 0xffffffff
AssertRelease(v <= 0xffffffff);
#endif
return (uint32_t)v;
}