Index: src/heap/heap.h |
diff --git a/src/heap/heap.h b/src/heap/heap.h |
index d1e80e1b82d761cedf48fcfdefe20d7fd3e45438..c911519b225db96aa4224d2dbfe5251a4d375470 100644 |
--- a/src/heap/heap.h |
+++ b/src/heap/heap.h |
@@ -1092,7 +1092,10 @@ class Heap { |
inline intptr_t PromotedTotalSize() { |
int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); |
- if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt); |
+ if (total > std::numeric_limits<intptr_t>::max()) { |
+ // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations. |
+ return std::numeric_limits<intptr_t>::max(); |
+ } |
if (total < 0) return 0; |
return static_cast<intptr_t>(total); |
} |