Fix -O2 optimization crash with gcc 2.96 or 3.0.{1,2} by not inlining |#ifdef __GNUC__|. b=106891 r=pavlov sr=brendan

This commit is contained in:
dbaron%fas.harvard.edu 2001-10-28 21:02:05 +00:00
Родитель f63c07feb6
Коммит 0dfd2996bb
2 изменённых файлов: 20 добавлений и 0 удалений

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

@ -60,6 +60,18 @@ imgContainer::~imgContainer()
mFrames.Clear();
}
#ifdef CANT_INLINE_GETTER
// This should be inlined but inlining it breaks on recent versions of
// gcc (2.96-85, 3.0.1) with -O2.
nsresult imgContainer::inlinedGetFrameAt(PRUint32 index,
gfxIImageFrame **_retval)
{
*_retval = NS_STATIC_CAST(gfxIImageFrame*, mFrames.ElementAt(index));
if (!*_retval) return NS_ERROR_FAILURE;
return NS_OK;
}
#endif
//******************************************************************************
/* void init (in nscoord aWidth, in nscoord aHeight, in imgIContainerObserver aObserver); */
NS_IMETHODIMP imgContainer::Init(nscoord aWidth, nscoord aHeight, imgIContainerObserver *aObserver)

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

@ -42,6 +42,10 @@
#include "nsWeakReference.h"
#ifdef __GNUC__
#define CANT_INLINE_GETTER
#endif
#define NS_IMGCONTAINER_CID \
{ /* 5e04ec5e-1dd2-11b2-8fda-c4db5fb666e0 */ \
0x5e04ec5e, \
@ -73,11 +77,15 @@ private:
return nframes;
}
#ifdef CANT_INLINE_GETTER
nsresult inlinedGetFrameAt(PRUint32 index, gfxIImageFrame **_retval);
#else
inline nsresult inlinedGetFrameAt(PRUint32 index, gfxIImageFrame **_retval) {
*_retval = NS_STATIC_CAST(gfxIImageFrame*, mFrames.ElementAt(index));
if (!*_retval) return NS_ERROR_FAILURE;
return NS_OK;
}
#endif
inline nsresult inlinedGetCurrentFrame(gfxIImageFrame **_retval) {
if (mCompositingFrame) {