Bug 1273152 - modify autogen python to prevent null pointer dereference on generates cpps. r?jst draft
authorAndi-Bogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Mon, 16 May 2016 17:39:12 +0300
changeset 367393 a708c829e74e08bdfcd1a5d9e88c999e38a42ece
parent 367249 d0be57e84807ce0853b2406de7ff6abb195ac898
child 521000 4c4cb4f2a0c37747fe75b7583e0f8f1cf5b6688c
push id18229
push userBogdan.Postelnicu@softvision.ro
push dateMon, 16 May 2016 14:42:49 +0000
reviewersjst
bugs1273152
milestone49.0a1
Bug 1273152 - modify autogen python to prevent null pointer dereference on generates cpps. r?jst MozReview-Commit-ID: 3dqJsJL7naw
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -12341,20 +12341,20 @@ class CGDictionary(CGThing):
 
                 """,
                 dictName=self.makeClassName(self.dictionary.parent))
         else:
             body += dedent(
                 """
                 { // scope for isConvertible
                   bool isConvertible;
-                  if (!IsConvertibleToDictionary(cx, val, &isConvertible)) {
+                  if (cx && !IsConvertibleToDictionary(cx, val, &isConvertible)) {
                     return false;
                   }
-                  if (!isConvertible) {
+                  if (cx && !isConvertible) {
                     return ThrowErrorMessage(cx, MSG_NOT_DICTIONARY, sourceDescription);
                   }
                 }
 
                 """)
 
         memberInits = [self.getMemberConversion(m).define()
                        for m in self.memberInfo]