Fix alignment issue causing Bug 583779 - 8/2 Android Nightly Build does not open on start-up. r=vlad (CLOSED TREE)
authorAlan Pierce <apierce@mozilla.com>
Tue, 03 Aug 2010 20:31:48 -0700
changeset 48792 f74c17026fd23296e0557708ce5e09a0eb3c2fb2
parent 48791 ecec4342b281466704af8561de6db5da35a95f2e
child 48794 dfd4d8582ef3fb07f7b8720066976924a6cbe347
push id14820
push userrsayre@mozilla.com
push dateWed, 04 Aug 2010 03:36:53 +0000
treeherdermozilla-central@f74c17026fd2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs583779
milestone2.0b3pre
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
Fix alignment issue causing Bug 583779 - 8/2 Android Nightly Build does not open on start-up. r=vlad (CLOSED TREE)
js/src/jsstr.h
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -1006,32 +1006,18 @@ js_strchr_limit(const jschar *s, jschar 
 inline void
 js_short_strncpy(jschar *dest, const jschar *src, size_t num)
 {
     /*
      * It isn't strictly necessary here for |num| to be small, but this function
      * is currently only called on buffers for short strings.
      */
     JS_ASSERT(JSShortString::fitsIntoShortString(num));
-    switch (num) {
-      case 1:
-        *dest = *src;
-        break;
-      case 2:
-        JS_ASSERT(sizeof(uint32) == 2 * sizeof(jschar));
-        *(uint32 *)dest = *(uint32 *)src;
-        break;
-      case 4:
-        JS_ASSERT(sizeof(uint64) == 4 * sizeof(jschar));
-        *(uint64 *)dest = *(uint64 *)src;
-        break;
-      default:
-        for (size_t i = 0; i < num; i++)
-            dest[i] = src[i];
-    }
+    for (size_t i = 0; i < num; i++)
+        dest[i] = src[i];
 }
 
 /*
  * Return s advanced past any Unicode white space characters.
  */
 static inline const jschar *
 js_SkipWhiteSpace(const jschar *s, const jschar *end)
 {