Bug 1170859- MIPS64: Fix copy u32 type arg to argument register. r=froydnj
authorHeiher <r@hev.cc>
Tue, 02 Jun 2015 18:49:00 -0400
changeset 269688 42417785fae03fd72cc7501aabcb4f356dd590fe
parent 269687 21b703601d17ab2a796bb3d676e9fee0cab268b8
child 269689 1a41e3cf04b32b71086d377031e6e4065e30247e
push id2540
push userwcosta@mozilla.com
push dateWed, 03 Jun 2015 20:55:41 +0000
reviewersfroydnj
bugs1170859
milestone41.0a1
Bug 1170859- MIPS64: Fix copy u32 type arg to argument register. r=froydnj
xpcom/reflect/xptcall/md/unix/xptcinvoke_mips64.cpp
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_mips64.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_mips64.cpp
@@ -72,17 +72,19 @@ invoke_copy_to_stack(uint64_t* d, uint32
         case nsXPTType::T_U16:
             if (i < N_ARG_REGS)
                 regs[i] = s->val.u16;
             else
                 *d++ = s->val.u16;
             break;
         case nsXPTType::T_U32:
             if (i < N_ARG_REGS)
-                regs[i] = s->val.u32;
+		// 32-bit values need to be sign-extended
+		// in register, so use the signed value.
+                regs[i] = s->val.i32;
             else
                 *d++ = s->val.u32;
             break;
         case nsXPTType::T_U64:
             if (i < N_ARG_REGS)
                 regs[i] = s->val.u64;
             else
                 *d++ = s->val.u64;