mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 293307 violation of c++ aliasing rules in imgCacheValidator::OnStartRequest() causing crash if compiled with gcc 4.0
r=pavlov sr=bz a=shaver
This commit is contained in:
parent
08ae7f279b
commit
048e93260c
@ -926,7 +926,7 @@ void imgCacheValidator::AddProxy(imgRequestProxy *aProxy)
|
||||
// the network.
|
||||
aProxy->AddToLoadGroup();
|
||||
|
||||
mProxies.AppendElement(NS_STATIC_CAST(imgIRequest *, aProxy));
|
||||
mProxies.AppendObject(aProxy);
|
||||
}
|
||||
|
||||
/** nsIRequestObserver methods **/
|
||||
@ -939,13 +939,10 @@ NS_IMETHODIMP imgCacheValidator::OnStartRequest(nsIRequest *aRequest, nsISupport
|
||||
PRBool isFromCache;
|
||||
if (NS_SUCCEEDED(cacheChan->IsFromCache(&isFromCache)) && isFromCache) {
|
||||
|
||||
PRUint32 count;
|
||||
mProxies.Count(&count);
|
||||
PRUint32 count = mProxies.Count();
|
||||
for (PRInt32 i = count-1; i>=0; i--) {
|
||||
imgRequestProxy *proxy;
|
||||
mProxies.GetElementAt(i, (nsISupports**)&proxy);
|
||||
imgRequestProxy *proxy = NS_STATIC_CAST(imgRequestProxy *, mProxies[i]);
|
||||
mRequest->NotifyProxyListener(proxy);
|
||||
NS_RELEASE(proxy);
|
||||
}
|
||||
|
||||
mRequest->SetLoadId(mContext);
|
||||
@ -994,14 +991,11 @@ NS_IMETHODIMP imgCacheValidator::OnStartRequest(nsIRequest *aRequest, nsISupport
|
||||
|
||||
mDestListener = NS_STATIC_CAST(nsIStreamListener*, pl);
|
||||
|
||||
PRUint32 count;
|
||||
mProxies.Count(&count);
|
||||
PRUint32 count = mProxies.Count();
|
||||
for (PRInt32 i = count-1; i>=0; i--) {
|
||||
imgRequestProxy *proxy;
|
||||
mProxies.GetElementAt(i, (nsISupports**)&proxy);
|
||||
imgRequestProxy *proxy = NS_STATIC_CAST(imgRequestProxy *, mProxies[i]);
|
||||
proxy->ChangeOwner(request);
|
||||
request->NotifyProxyListener(proxy);
|
||||
NS_RELEASE(proxy);
|
||||
}
|
||||
|
||||
NS_RELEASE(request);
|
||||
|
@ -106,7 +106,7 @@ private:
|
||||
* validate checker
|
||||
*/
|
||||
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsCOMArray.h"
|
||||
|
||||
class imgCacheValidator : public nsIStreamListener
|
||||
{
|
||||
@ -125,7 +125,7 @@ private:
|
||||
nsCOMPtr<nsIStreamListener> mDestListener;
|
||||
|
||||
imgRequest *mRequest;
|
||||
nsSupportsArray mProxies;
|
||||
nsCOMArray<imgIRequest> mProxies;
|
||||
|
||||
void *mContext;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user