Harden runtime functions

Part 1 of many.

R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/239313002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20836 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6d475fb3
This diff is collapsed.
......@@ -75,9 +75,8 @@ inline bool TryNumberToSize(Isolate* isolate,
SealHandleScope shs(isolate);
if (number->IsSmi()) {
int value = Smi::cast(number)->value();
ASSERT(
static_cast<unsigned>(Smi::kMaxValue)
<= std::numeric_limits<size_t>::max());
ASSERT(static_cast<unsigned>(Smi::kMaxValue)
<= std::numeric_limits<size_t>::max());
if (value >= 0) {
*result = static_cast<size_t>(value);
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment