From 0bf577cd7404714cc50e88f71e41c555db6fa70f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Wed, 3 May 2017 10:40:51 -0400 Subject: [PATCH] Bug 1352093 - Use an integer type for sNumLivingContexts that won't overflow when counting objects. r=mstange MozReview-Commit-ID: 2w9y0flEdrX --HG-- extra : rebase_source : 199beffa993b756ef208f6070a9f5c3de0d2fea0 --- dom/canvas/CanvasRenderingContext2D.cpp | 2 +- dom/canvas/CanvasRenderingContext2D.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index bca74bad0d27..cdb178d2d545 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -1081,7 +1081,7 @@ NS_INTERFACE_MAP_END // Initialize our static variables. -uint32_t CanvasRenderingContext2D::sNumLivingContexts = 0; +uintptr_t CanvasRenderingContext2D::sNumLivingContexts = 0; DrawTarget* CanvasRenderingContext2D::sErrorTarget = nullptr; static bool sMaxContextsInitialized = false; static int32_t sMaxContexts = 0; diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index 870599c48038..c0402515e09d 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -578,7 +578,7 @@ protected: * The number of living nsCanvasRenderingContexts. When this goes down to * 0, we free the premultiply and unpremultiply tables, if they exist. */ - static uint32_t sNumLivingContexts; + static uintptr_t sNumLivingContexts; static mozilla::gfx::DrawTarget* sErrorTarget;