Assert that we don't leak JSVAL_ERROR_COOKIE along the JSVAL_BOXED path (r=me, debug only.)
authorAndreas Gal <gal@mozilla.com>
Wed, 04 Feb 2009 17:42:34 -0800
changeset 24842 ae5d5b241949e76e0b0f33fca0e0646a892b4f74
parent 24838 bd6990ab2cd72b2cada19a2137e5a805c93b9d7a
child 24843 f5060d0e5833208edb62523cef918808f8c4116e
push idunknown
push userunknown
push dateunknown
reviewersme, debug
milestone1.9.2a1pre
Assert that we don't leak JSVAL_ERROR_COOKIE along the JSVAL_BOXED path (r=me, debug only.)
js/src/jstracer.cpp
--- a/js/src/jstracer.cpp
+++ b/js/src/jstracer.cpp
@@ -1576,16 +1576,17 @@ NativeToValue(JSContext* cx, jsval& v, u
       }
       case JSVAL_STRING:
         v = STRING_TO_JSVAL(*(JSString**)slot);
         JS_ASSERT(JSVAL_TAG(v) == JSVAL_STRING); /* if this fails the pointer was not aligned */
         debug_only_v(printf("string<%p> ", *(JSString**)slot);)
         break;
       case JSVAL_BOXED:
         v = *(jsval*)slot;
+        JS_ASSERT(v != JSVAL_ERROR_COOKIE); /* don't leak JSVAL_ERROR_COOKIE */
         debug_only_v(printf("box<%lx> ", v));
         break;
       case JSVAL_TNULL:
         JS_ASSERT(*(JSObject**)slot == NULL);
         v = JSVAL_NULL;
         debug_only_v(printf("null<%p> ", *(JSObject**)slot));
         break;
       default: