Bug 1301033 - add assert cx on generated code in order to prevent false-positive from static analysis tools. r=baku
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 07 Sep 2016 15:32:02 +0300
changeset 313057 22cea8abf7e408bf742b3f1d97049bb99a3ac440
parent 313056 7361e1768b80b32d7e48140687027e70f25a6c55
child 313058 b84791fdddb2458fe44a22dafe714426b569b20a
push id20479
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 01:08:46 +0000
treeherderfx-team@fb7c6b034329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1301033
milestone51.0a1
Bug 1301033 - add assert cx on generated code in order to prevent false-positive from static analysis tools. r=baku MozReview-Commit-ID: ELTP8E3zRNf
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12316,16 +12316,17 @@ class CGDictionary(CGThing):
         if memberInits:
             body += fill(
                 """
                 bool isNull = val.isNullOrUndefined();
                 // We only need these if !isNull, in which case we have |cx|.
                 Maybe<JS::Rooted<JSObject *> > object;
                 Maybe<JS::Rooted<JS::Value> > temp;
                 if (!isNull) {
+                  MOZ_ASSERT(cx);
                   object.emplace(cx, &val.toObject());
                   temp.emplace(cx);
                 }
                 $*{memberInits}
                 """,
                 memberInits="\n".join(memberInits))
 
         body += "return true;\n"