bug 432917: Replace "must flow through label" comments with statically-checkable macro. r=igor

This commit is contained in:
Taras Glek
2008-09-08 10:51:10 -07:00
parent 68517dddae
commit c7528a9f01
12 changed files with 95 additions and 22 deletions

View File

@@ -97,6 +97,7 @@
#include "jsobj.h"
#include "jsscope.h"
#include "jsstr.h"
#include "jsstaticcheck.h"
/* 2^32 - 1 as a number and a string */
#define MAXINDEX 4294967295u
@@ -2278,7 +2279,7 @@ array_splice(JSContext *cx, uintN argc, jsval *vp)
argv++;
}
/* After this, control must flow through label out: to exit. */
MUST_FLOW_THROUGH("out");
JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
/* If there are elements to remove, put them into the return value. */
@@ -2391,7 +2392,7 @@ array_concat(JSContext *cx, uintN argc, jsval *vp)
length = 0;
}
/* After this, control must flow through label out: to exit. */
MUST_FLOW_THROUGH("out");
JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
/* Loop over [0, argc] to concat args into nobj, expanding all Arrays. */
@@ -2519,7 +2520,7 @@ array_slice(JSContext *cx, uintN argc, jsval *vp)
return JS_FALSE;
*vp = OBJECT_TO_JSVAL(nobj);
/* After this, control must flow through label out: to exit. */
MUST_FLOW_THROUGH("out");
JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
for (slot = begin; slot < end; slot++) {
@@ -2739,7 +2740,7 @@ array_extra(JSContext *cx, ArrayExtraMode mode, uintN argc, jsval *vp)
if (!elemroot)
return JS_FALSE;
/* From this point the control must flow through out:. */
MUST_FLOW_THROUGH("out");
ok = JS_TRUE;
invokevp = elemroot + 1;