Bug 1311748: Remove extra pointer dereference from MainThreadHandoff::FixArrayElements; r?jimm
MozReview-Commit-ID: 2hLgQ1km07J
--- a/ipc/mscom/MainThreadHandoff.cpp
+++ b/ipc/mscom/MainThreadHandoff.cpp
@@ -253,21 +253,20 @@ MainThreadHandoff::FixArrayElements(ICal
// ICallFrame::GetParam is not able to coerce the param into a VARIANT.
// That's ok, we can try to do it ourselves.
CALLFRAMEPARAMINFO paramInfo;
hr = aFrame->GetParamInfo(aArrayData.mArrayParamIndex, ¶mInfo);
if (FAILED(hr)) {
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 {
arrayPtr = ResolveArrayPtr(paramVal);
}
MOZ_ASSERT(arrayPtr);
if (!arrayPtr) {