Commit 5f609b3c authored by mbrandy's avatar mbrandy Committed by Commit bot

Fix uninitialized variable compiler errors [GCC 4.8.4]

R=svenpanne@chromium.org, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#28835}
parent 54309ebb
......@@ -3665,7 +3665,7 @@ i::MaybeHandle<i::Object> DeleteObjectProperty(
i::Isolate* isolate, i::Handle<i::JSReceiver> receiver,
i::Handle<i::Object> key, i::LanguageMode language_mode) {
// Check if the given key is an array index.
uint32_t index;
uint32_t index = 0;
if (key->ToArrayIndex(&index)) {
// In Firefox/SpiderMonkey, Safari and Opera you can access the
// characters of a string using [] notation. In the case of a
......@@ -3976,7 +3976,7 @@ Maybe<bool> v8::Object::Has(Local<Context> context, Local<Value> key) {
auto key_obj = Utils::OpenHandle(*key);
Maybe<bool> maybe = Nothing<bool>();
// Check if the given key is an array index.
uint32_t index;
uint32_t index = 0;
if (key_obj->ToArrayIndex(&index)) {
maybe = i::JSReceiver::HasElement(self, index);
} else {
......
......@@ -1887,7 +1887,7 @@ void JSObject::EnsureCanContainElements(Handle<JSObject> object,
bool JSObject::WouldConvertToSlowElements(Handle<Object> key) {
uint32_t index;
uint32_t index = 0;
return key->ToArrayIndex(&index) && WouldConvertToSlowElements(index);
}
......
......@@ -306,7 +306,7 @@ RUNTIME_FUNCTION(Runtime_LoadKeyedFromSuper) {
CONVERT_ARG_HANDLE_CHECKED(JSObject, home_object, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, key, 2);
uint32_t index;
uint32_t index = 0;
if (key->ToArrayIndex(&index)) {
return LoadElementFromSuper(isolate, receiver, home_object, index);
}
......@@ -394,7 +394,7 @@ static Object* StoreKeyedToSuper(Isolate* isolate, Handle<JSObject> home_object,
Handle<Object> receiver, Handle<Object> key,
Handle<Object> value,
LanguageMode language_mode) {
uint32_t index;
uint32_t index = 0;
if (key->ToArrayIndex(&index)) {
return StoreElementToSuper(isolate, home_object, receiver, index, value,
......
......@@ -61,7 +61,7 @@ MaybeHandle<Object> Runtime::GetObjectProperty(Isolate* isolate,
}
// Check if the given key is an array index.
uint32_t index;
uint32_t index = 0;
if (key->ToArrayIndex(&index)) {
return GetElementOrCharAt(isolate, object, index);
}
......@@ -106,7 +106,7 @@ MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate,
}
// Check if the given key is an array index.
uint32_t index;
uint32_t index = 0;
if (key->ToArrayIndex(&index)) {
// TODO(verwaest): Support non-JSObject receivers.
if (!object->IsJSObject()) return value;
......@@ -182,7 +182,7 @@ MaybeHandle<Object> Runtime::DefineObjectProperty(Handle<JSObject> js_object,
PropertyAttributes attrs) {
Isolate* isolate = js_object->GetIsolate();
// Check if the given key is an array index.
uint32_t index;
uint32_t index = 0;
if (key->ToArrayIndex(&index)) {
// In Firefox/SpiderMonkey, Safari and Opera you can access the characters
// of a string using [] notation. We need to support this too in
......
......@@ -1063,7 +1063,7 @@ RUNTIME_FUNCTION(Runtime_GetArgumentsProperty) {
// Try to convert the key to an index. If successful and within
// index return the the argument from the frame.
uint32_t index;
uint32_t index = 0;
if (raw_key->ToArrayIndex(&index) && index < n) {
return frame->GetParameter(index);
}
......
......@@ -139,7 +139,7 @@ RUNTIME_FUNCTION(Runtime_StringIndexOf) {
CONVERT_ARG_HANDLE_CHECKED(String, pat, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, index, 2);
uint32_t start_index;
uint32_t start_index = 0;
if (!index->ToArrayIndex(&start_index)) return Smi::FromInt(-1);
RUNTIME_ASSERT(start_index <= static_cast<uint32_t>(sub->length()));
......@@ -190,7 +190,7 @@ RUNTIME_FUNCTION(Runtime_StringLastIndexOf) {
CONVERT_ARG_HANDLE_CHECKED(String, pat, 1);
CONVERT_ARG_HANDLE_CHECKED(Object, index, 2);
uint32_t start_index;
uint32_t start_index = 0;
if (!index->ToArrayIndex(&start_index)) return Smi::FromInt(-1);
uint32_t pat_length = pat->length();
......
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