From 0a7e6c2c056f45d2bd5935d5d7e04697248ad7a0 Mon Sep 17 00:00:00 2001 From: Andi-Bogdan Postelnicu Date: Tue, 20 Sep 2016 15:11:08 +0300 Subject: [PATCH] Bug 1302442 - Add ignore-initialization-check annotation to class member variables constructed by Codegen. r=peterv MozReview-Commit-ID: 2vd6EELGSSj --HG-- extra : rebase_source : 810b61ea983b8a2636130f488c13b1ee61996aef --- dom/bindings/Codegen.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 8007f303f131..46e136775a38 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -10255,15 +10255,18 @@ class ClassDestructor(ClassItem): class ClassMember(ClassItem): def __init__(self, name, type, visibility="private", static=False, - body=None): + body=None, hasIgnoreInitCheckFlag=False): self.type = type self.static = static self.body = body + self.hasIgnoreInitCheckFlag = hasIgnoreInitCheckFlag; ClassItem.__init__(self, name, visibility) def declare(self, cgClass): - return '%s%s %s;\n' % ('static ' if self.static else '', self.type, - self.name) + return '%s%s%s %s;\n' % ('static ' if self.static else '', + 'MOZ_INIT_OUTSIDE_CTOR ' + if self.hasIgnoreInitCheckFlag else '', + self.type, self.name) def define(self, cgClass): if not self.static: @@ -12519,7 +12522,8 @@ class CGDictionary(CGThing): members = [ClassMember(self.makeMemberName(m[0].identifier.name), self.getMemberType(m), visibility="public", - body=self.getMemberInitializer(m)) + body=self.getMemberInitializer(m), + hasIgnoreInitCheckFlag=True) for m in self.memberInfo] if d.parent: # We always want to init our parent with our non-initializing