Commit 44b9f1e7 authored by mbrandy's avatar mbrandy Committed by Commit bot

AIX: Fix 'may be used uninitialized' compiler errors

Fix additional cases where the AIX compiler reports that a variable
may be used uninitialized.

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

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

Cr-Commit-Position: refs/heads/master@{#30658}
parent 1b191a5d
......@@ -126,7 +126,7 @@ AllocationResult Heap::AllocateOneByteInternalizedString(
AllocationSpace space = SelectSpace(size, TENURED);
// Allocate string.
HeapObject* result;
HeapObject* result = nullptr;
{
AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
if (!allocation.To(&result)) return allocation;
......@@ -158,7 +158,7 @@ AllocationResult Heap::AllocateTwoByteInternalizedString(Vector<const uc16> str,
AllocationSpace space = SelectSpace(size, TENURED);
// Allocate string.
HeapObject* result;
HeapObject* result = nullptr;
{
AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
if (!allocation.To(&result)) return allocation;
......@@ -206,7 +206,7 @@ AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space,
isolate_->counters()->objs_since_last_young()->Increment();
#endif
HeapObject* object;
HeapObject* object = nullptr;
AllocationResult allocation;
if (NEW_SPACE == space) {
allocation = new_space_.AllocateRaw(size_in_bytes, alignment);
......
This diff is collapsed.
......@@ -2941,7 +2941,7 @@ bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
OldSpace* old_space = heap()->old_space();
HeapObject* target;
HeapObject* target = nullptr;
AllocationAlignment alignment = object->RequiredAlignment();
AllocationResult allocation = old_space->AllocateRaw(object_size, alignment);
if (allocation.To(&target)) {
......@@ -3193,7 +3193,7 @@ void MarkCompactCollector::EvacuateLiveObjectsFromPage(Page* p) {
int size = object->Size();
AllocationAlignment alignment = object->RequiredAlignment();
HeapObject* target_object;
HeapObject* target_object = nullptr;
AllocationResult allocation = space->AllocateRaw(size, alignment);
if (!allocation.To(&target_object)) {
// If allocation failed, use emergency memory and re-try allocation.
......
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