Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: src/objects.cc

Issue 1384673003: Fix FixedArrayBase cast in NumberOfOwnElements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-538086.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index e137e3f606b3ab3ceea293aa24151fbe3252197a..68e63f94e3b9db1f10cedfa66b6e3e0214e45c0f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -13901,10 +13901,11 @@ int JSObject::GetOwnPropertyNames(FixedArray* storage, int index,
int JSObject::NumberOfOwnElements(PropertyAttributes filter) {
// Fast case for objects with no elements.
if (!IsJSValue() && HasFastElements()) {
- uint32_t length = IsJSArray() ?
- static_cast<uint32_t>(
- Smi::cast(JSArray::cast(this)->length())->value()) :
- static_cast<uint32_t>(FixedArray::cast(elements())->length());
+ uint32_t length =
+ IsJSArray()
+ ? static_cast<uint32_t>(
+ Smi::cast(JSArray::cast(this)->length())->value())
+ : static_cast<uint32_t>(FixedArrayBase::cast(elements())->length());
if (length == 0) return 0;
}
// Compute the number of enumerable elements.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-538086.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698