Changeset 214071 in webkit for trunk/Source/JavaScriptCore/ftl/FTLOperations.cpp
- Timestamp:
- Mar 16, 2017, 2:53:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ftl/FTLOperations.cpp
r214040 r214071 1 1 /* 2 * Copyright (C) 2014 , 2015Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 439 439 Structure* structure = globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous); 440 440 441 unsigned arraySize = 0;441 Checked<unsigned, RecordOverflow> checkedArraySize = 0; 442 442 unsigned numProperties = 0; 443 443 for (unsigned i = materialization->properties().size(); i--;) { … … 447 447 JSValue value = JSValue::decode(values[i]); 448 448 if (JSFixedArray* fixedArray = jsDynamicCast<JSFixedArray*>(vm, value)) 449 arraySize += fixedArray->size();449 checkedArraySize += fixedArray->size(); 450 450 else 451 arraySize += 1; 452 } 453 } 454 451 checkedArraySize += 1; 452 } 453 } 454 455 unsigned arraySize = checkedArraySize.unsafeGet(); // Crashes if overflowed. 455 456 JSArray* result = JSArray::tryCreateForInitializationPrivate(vm, structure, arraySize); 456 457 RELEASE_ASSERT(result);
Note:
See TracChangeset
for help on using the changeset viewer.