From: dslomov@chromium.org Date: Thu, 14 Nov 2013 11:19:30 +0000 (+0000) Subject: Revert "Harden NumberToSize against overflows." X-Git-Tag: upstream/4.7.83~11755 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe70e2d6940be8322f5e0f4020d55e1390d7be33;p=platform%2Fupstream%2Fv8.git Revert "Harden NumberToSize against overflows." This reverts commit r17733 for breaking Linux build. TBR=jkummerow@chromium.org BUG= Review URL: https://codereview.chromium.org/69243005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/v8conversions.h b/src/v8conversions.h index b1d96b4..3a7b524 100644 --- a/src/v8conversions.h +++ b/src/v8conversions.h @@ -60,15 +60,10 @@ inline size_t NumberToSize(Isolate* isolate, Object* number) { SealHandleScope shs(isolate); if (number->IsSmi()) { - int value = Smi::cast(number)->value(); - CHECK_GE(value, 0); - ASSERT(Smi::kMaxValue <= std::numeric_limits::max()); - return static_cast(value); + return Smi::cast(number)->value(); } else { ASSERT(number->IsHeapNumber()); double value = HeapNumber::cast(number)->value(); - CHECK(value >= 0 && - value <= std::numeric_limits::max()); return static_cast(value); } }