Bug 821628 - xptcstubs_x86_64_darwin is wrongly converting some bool params
authorMarco Bonardo <mbonardo@mozilla.com>
Thu, 20 Dec 2012 23:44:40 +0100
changeset 125832 2a2087aaedc55363913a4a337ea9db69e695bf88
parent 125831 9901508358d30b50228ce35fce2992186b754915
child 125833 5356d4e7814c557882af1dd8453bb836ae084dc9
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs821628
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 821628 - xptcstubs_x86_64_darwin is wrongly converting some bool params r=bsmedberg
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_solaris.cpp
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
@@ -103,17 +103,18 @@ PrepareAndDispatch(nsXPTCStubBase * self
         case nsXPTType::T_I8:      dp->val.i8  = (int8_t)   value; break;
         case nsXPTType::T_I16:     dp->val.i16 = (int16_t)  value; break;
         case nsXPTType::T_I32:     dp->val.i32 = (int32_t)  value; break;
         case nsXPTType::T_I64:     dp->val.i64 = (int64_t)  value; break;
         case nsXPTType::T_U8:      dp->val.u8  = (uint8_t)  value; break;
         case nsXPTType::T_U16:     dp->val.u16 = (uint16_t) value; break;
         case nsXPTType::T_U32:     dp->val.u32 = (uint32_t) value; break;
         case nsXPTType::T_U64:     dp->val.u64 = (uint64_t) value; break;
-        case nsXPTType::T_BOOL:    dp->val.b   = (bool)   value; break;
+        // Cast to uint8_t first, to remove garbage on upper 56 bits.
+        case nsXPTType::T_BOOL:    dp->val.b   = (bool)(uint8_t)   value; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
 
         default:
             NS_ERROR("bad type");
             break;
         }
     }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
@@ -103,17 +103,18 @@ PrepareAndDispatch(nsXPTCStubBase * self
         case nsXPTType::T_I8:      dp->val.i8  = (int8_t)   value; break;
         case nsXPTType::T_I16:     dp->val.i16 = (int16_t)  value; break;
         case nsXPTType::T_I32:     dp->val.i32 = (int32_t)  value; break;
         case nsXPTType::T_I64:     dp->val.i64 = (int64_t)  value; break;
         case nsXPTType::T_U8:      dp->val.u8  = (uint8_t)  value; break;
         case nsXPTType::T_U16:     dp->val.u16 = (uint16_t) value; break;
         case nsXPTType::T_U32:     dp->val.u32 = (uint32_t) value; break;
         case nsXPTType::T_U64:     dp->val.u64 = (uint64_t) value; break;
-        case nsXPTType::T_BOOL:    dp->val.b   = (bool)   value; break;
+        // Cast to uint8_t first, to remove garbage on upper 56 bits.
+        case nsXPTType::T_BOOL:    dp->val.b   = (bool)(uint8_t)   value; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
 
         default:
             NS_ERROR("bad type");
             break;
         }
     }
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_solaris.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_solaris.cpp
@@ -103,17 +103,18 @@ PrepareAndDispatch(nsXPTCStubBase * self
         case nsXPTType::T_I8:      dp->val.i8  = (int8_t)   value; break;
         case nsXPTType::T_I16:     dp->val.i16 = (int16_t)  value; break;
         case nsXPTType::T_I32:     dp->val.i32 = (int32_t)  value; break;
         case nsXPTType::T_I64:     dp->val.i64 = (int64_t)  value; break;
         case nsXPTType::T_U8:      dp->val.u8  = (uint8_t)  value; break;
         case nsXPTType::T_U16:     dp->val.u16 = (uint16_t) value; break;
         case nsXPTType::T_U32:     dp->val.u32 = (uint32_t) value; break;
         case nsXPTType::T_U64:     dp->val.u64 = (uint64_t) value; break;
-        case nsXPTType::T_BOOL:    dp->val.b   = (bool)   value; break;
+        // Cast to uint8_t first, to remove garbage on upper 56 bits.
+        case nsXPTType::T_BOOL:    dp->val.b   = (bool)(uint8_t)   value; break;
         case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
         case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
 
         default:
             NS_ERROR("bad type");
             break;
         }
     }