Bug 1311748: Remove extra pointer dereference from MainThreadHandoff::FixArrayElements; r=jimm

MozReview-Commit-ID: 2hLgQ1km07J

--HG--
extra : rebase_source : 371222c8106fd662a4a455117621f22bbc1b3bef
This commit is contained in:
Aaron Klotz 2016-11-03 11:25:26 -06:00
Родитель 17ee4aac47
Коммит a7baaddbf0
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -256,11 +256,10 @@ MainThreadHandoff::FixArrayElements(ICallFrame* aFrame,
return hr;
}
PVOID stackBase = aFrame->GetStackLocation();
// We dereference twice because we need to obtain the value of a parameter
// from a stack offset (one), and since that is an outparam, we need to
// find the value that is actually being returned (two).
arrayPtr = **reinterpret_cast<PVOID**>(reinterpret_cast<PBYTE>(stackBase) +
paramInfo.stackOffset);
// We dereference because we need to obtain the value of a parameter
// from a stack offset. This pointer is the base of the array.
arrayPtr = *reinterpret_cast<PVOID*>(reinterpret_cast<PBYTE>(stackBase) +
paramInfo.stackOffset);
} else if (FAILED(hr)) {
return hr;
} else {