merge of '49118a4c6035353c0f8cf1aa30297dd36e43241f'
[vuplus_openembedded] / packages / mozilla / firefox-3.0 / Bug339782.additional.fix.diff
1 # XPTC_InvokeByIndex crashes
2 # Bug 339782  [ARM] XPTC_InvokeByIndex crashes when cross-compiled under GCC 3.4.x with EABI (CodeSourcery)
3 Index: mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
4 ===================================================================
5 --- mozilla.orig/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
6 +++ mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
7 @@ -51,22 +51,32 @@
8  #ifdef __ARM_EABI__
9  #define DOUBLEWORD_ALIGN(p) ((PRUint32 *)((((PRUint32)(p)) + 7) & 0xfffffff8))
10  #define VAR_STACK_SIZE_64 3
11  #else
12  #define DOUBLEWORD_ALIGN(p) (p)
13  #define VAR_STACK_SIZE_64 2
14  #endif
15  
16 +#ifdef __ARM_EABI__
17 +#define DOUBLEWORD_ALIGN(p) ((PRUint32 *)((((PRUint32)(p)) + 7) & 0xfffffff8))
18 +#else
19 +#define DOUBLEWORD_ALIGN(p) (p)
20 +#endif
21 +
22  // Remember that these 'words' are 32bit DWORDS
23  
24  static PRUint32
25  invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
26  {
27      PRUint32 result = 0;
28 +
29 +    /* Note that we give a "worst case" estimate of how much stack _might_ be
30 +     * needed, rather than the real count - this should be safe */
31 +
32      for(PRUint32 i = 0; i < paramCount; i++, s++)
33      {
34          if(s->IsPtrData())
35          {
36              result++;
37              continue;
38          }
39          switch(s->type)