Bug 488018: Fix bustage: any function using TRACE_2 needs an 'error' label.
authorJim Blandy <jimb@mozilla.org>
Thu, 30 Apr 2009 17:54:20 -0700
changeset 27934 077b41f067c114f6a0fdd5193cd79fc8098fa47c
parent 27933 78dc61dcc4c5e4262d6417946b0dcc8df44a0e65
child 27935 bf31ea893f39bf2f411843dcdc66ba9d3e2850b3
push id6785
push userrsayre@mozilla.com
push dateFri, 01 May 2009 16:28:04 +0000
treeherdermozilla-central@66c6b924875d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs488018
milestone1.9.2a1pre
Bug 488018: Fix bustage: any function using TRACE_2 needs an 'error' label.
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3752,17 +3752,17 @@ js_DefineNativeProperty(JSContext *cx, J
                                                 ? getter
                                                 : sprop->getter,
                                                 (attrs & JSPROP_SETTER)
                                                 ? setter
                                                 : sprop->setter);
 
             /* NB: obj == pobj, so we can share unlock code at the bottom. */
             if (!sprop)
-                goto bad;
+                goto error;
         } else if (prop) {
             /* NB: call OBJ_DROP_PROPERTY, as pobj might not be native. */
             OBJ_DROP_PROPERTY(cx, pobj, prop);
             prop = NULL;
             sprop = NULL;
         }
     }
 #endif /* JS_HAS_GETTER_SETTER */
@@ -3781,53 +3781,53 @@ js_DefineNativeProperty(JSContext *cx, J
     if (!getter)
         getter = clasp->getProperty;
     if (!setter)
         setter = clasp->setProperty;
 
     /* Get obj's own scope if it has one, or create a new one for obj. */
     scope = js_GetMutableScope(cx, obj);
     if (!scope)
-        goto bad;
+        goto error;
 
     added = false;
     if (!sprop) {
         /* Add a new property, or replace an existing one of the same id. */
         if (clasp->flags & JSCLASS_SHARE_ALL_PROPERTIES)
             attrs |= JSPROP_SHARED;
         sprop = js_AddScopeProperty(cx, scope, id, getter, setter,
                                     SPROP_INVALID_SLOT, attrs, flags,
                                     shortid);
         if (!sprop)
-            goto bad;
+            goto error;
         added = true;
     }
 
     /* Store value before calling addProperty, in case the latter GC's. */
     if (SPROP_HAS_VALID_SLOT(sprop, scope))
         LOCKED_OBJ_WRITE_BARRIER(cx, obj, sprop->slot, value);
 
     /* XXXbe called with lock held */
     ADD_PROPERTY_HELPER(cx, clasp, obj, scope, sprop, &value,
                         js_RemoveScopeProperty(cx, scope, id);
-                        goto bad);
+                        goto error);
 
     if (cacheResult) {
         JS_ASSERT_NOT_ON_TRACE(cx);
         JSPropCacheEntry *entry;
         entry = js_FillPropertyCache(cx, obj, 0, 0, obj, sprop, added);
         TRACE_2(SetPropHit, entry, sprop);
     }
     if (propp)
         *propp = (JSProperty *) sprop;
     else
         JS_UNLOCK_OBJ(cx, obj);
     return JS_TRUE;
 
-bad:
+error: // TRACE_2 jumps here on error, as well.
     JS_UNLOCK_OBJ(cx, obj);
     return JS_FALSE;
 }
 
 JS_FRIEND_API(JSBool)
 js_LookupProperty(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
                   JSProperty **propp)
 {
@@ -4529,16 +4529,18 @@ js_SetPropertyHelper(JSContext *cx, JSOb
             flags = JSREPORT_ERROR;
             if (attrs & JSPROP_READONLY) {
                 if (!JS_HAS_STRICT_OPTION(cx)) {
                     /* Just return true per ECMA if not in strict mode. */
                     PCMETER(cacheResult && JS_PROPERTY_CACHE(cx).rofills++);
                     if (cacheResult)
                         TRACE_2(SetPropHit, JS_NO_PROP_CACHE_FILL, sprop);
                     return JS_TRUE;
+                error: // TRACE_2 jumps here in case of error.
+                    return JS_FALSE;
                 }
 
                 /* Strict mode: report a read-only strict warning. */
                 flags = JSREPORT_STRICT | JSREPORT_WARNING;
             }
             goto read_only_error;
         }