[INFER] Always ensure XDR'd scripts have a shape, bug 649103.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 11 Apr 2011 16:39:29 -0700
changeset 74927 752402c11d02f3b2d83914783b6c2440af15d328
parent 74926 265baede77e319379f562fcdebe18184a84e706c
child 74928 b442ad97a2fb596f12f0c919c73fc579ab79bba9
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs649103
milestone2.2a1pre
[INFER] Always ensure XDR'd scripts have a shape, bug 649103.
js/src/jsscript.cpp
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -447,22 +447,22 @@ js_XDRScript(JSXDRState *xdr, JSScript *
                                       JS_BIT(i & (JS_BITS_PER_UINT32 - 1))
                                       ? CONSTANT
                                       : VARIABLE)
                                    : UPVAR;
                 if (!bindings.add(cx, name, kind))
                     return false;
             }
         }
+    }
 
-        if (xdr->mode == JSXDR_DECODE) {
-            if (!bindings.ensureShape(cx))
-                return false;
-            bindings.makeImmutable();
-        }
+    if (xdr->mode == JSXDR_DECODE) {
+        if (!bindings.ensureShape(cx))
+            return false;
+        bindings.makeImmutable();
     }
 
     if (xdr->mode == JSXDR_ENCODE)
         length = script->length;
     if (!JS_XDRUint32(xdr, &length))
         return JS_FALSE;
 
     if (xdr->mode == JSXDR_ENCODE) {