$OpenBSD: patch-js_src_jsscript_cpp,v 1.1 2010/03/25 16:34:09 landry Exp $
Fix alignment issues on sparc64
https://bugzilla.mozilla.org/show_bug.cgi?id=514645
http://hg.mozilla.org/mozilla-central/rev/4c38883a0438
--- js/src/jsscript.cpp.orig	Thu Mar 25 09:11:45 2010
+++ js/src/jsscript.cpp	Thu Mar 25 09:13:11 2010
@@ -1430,14 +1430,6 @@ js_NewScript(JSContext *cx, uint32 length, uint32 nsrc
         cursor += vectorSize;
     }
 
-    if (nupvars != 0) {
-        JS_SCRIPT_UPVARS(script)->length = nupvars;
-        JS_SCRIPT_UPVARS(script)->vector = (uint32 *)cursor;
-        vectorSize = nupvars * sizeof(JS_SCRIPT_UPVARS(script)->vector[0]);
-        memset(cursor, 0, vectorSize);
-        cursor += vectorSize;
-    }
-
     if (nregexps != 0) {
         JS_SCRIPT_REGEXPS(script)->length = nregexps;
         JS_SCRIPT_REGEXPS(script)->vector = (JSObject **)cursor;
@@ -1453,6 +1445,14 @@ js_NewScript(JSContext *cx, uint32 length, uint32 nsrc
 #ifdef DEBUG
         memset(cursor, 0, vectorSize);
 #endif
+        cursor += vectorSize;
+    }
+
+    if (nupvars != 0) {
+        JS_SCRIPT_UPVARS(script)->length = nupvars;
+        JS_SCRIPT_UPVARS(script)->vector = (uint32 *)cursor;
+        vectorSize = nupvars * sizeof(JS_SCRIPT_UPVARS(script)->vector[0]);
+        memset(cursor, 0, vectorSize);
         cursor += vectorSize;
     }
 
