Bug 977224 - ctypes.Int64(0x8000000000000000) does not throw type error on PowerPC. r=jorendorff
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 28 Feb 2014 09:11:37 -0500
changeset 171507 7e217afc70021b83999d60bf39b7a5cd90a7ef36
parent 171506 43137b4b4b2a3a2ff37456063274ef93a298d03a
child 171508 1e7a52cc11588971ff831e15205c5772e7f0f66e
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersjorendorff
bugs977224
milestone30.0a1
Bug 977224 - ctypes.Int64(0x8000000000000000) does not throw type error on PowerPC. r=jorendorff
js/src/ctypes/CTypes.cpp
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1442,17 +1442,17 @@ struct ConvertImpl<uint64_t, double> {
   }
 };
 #endif
 
 // C++ doesn't guarantee that exact values are the only ones that will
 // round-trip. In fact, on some platforms, including SPARC, there are pairs of
 // values, a uint64_t and a double, such that neither value is exactly
 // representable in the other type, but they cast to each other.
-#ifdef SPARC
+#if defined(SPARC) || defined(__powerpc__)
 // Simulate x86 overflow behavior
 template<>
 struct ConvertImpl<uint64_t, double> {
   static MOZ_ALWAYS_INLINE uint64_t Convert(double d) {
     return d >= 0xffffffffffffffff ?
            0x8000000000000000 : uint64_t(d);
   }
 };