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
This commit is contained in:
jkummerow@chromium.org 2014-04-17 09:55:53 +00:00
parent 6d475fb350
commit 09c615940c
2 changed files with 187 additions and 165 deletions

File diff suppressed because it is too large Load Diff

View File

@ -75,8 +75,7 @@ inline bool TryNumberToSize(Isolate* isolate,
SealHandleScope shs(isolate);
if (number->IsSmi()) {
int value = Smi::cast(number)->value();
ASSERT(
static_cast<unsigned>(Smi::kMaxValue)
ASSERT(static_cast<unsigned>(Smi::kMaxValue)
<= std::numeric_limits<size_t>::max());
if (value >= 0) {
*result = static_cast<size_t>(value);