From 917dc99198791c9704acaaaee0c1c926850dbc78 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Sat, 4 Aug 2012 09:44:00 +0200 Subject: [PATCH] Bug 776224 - CheckPref should always initialize its outparam; r=peterv --- dom/bindings/Codegen.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index b64435a864b4..edb95f9a9a12 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -1213,24 +1213,27 @@ def CheckPref(descriptor, globalName, varName, retval, wrapperCache = None): """ if not descriptor.prefable: return "" + if wrapperCache: wrapperCache = " %s->ClearIsDOMBinding();\n" % (wrapperCache) else: wrapperCache = "" + + failureCode = (" %s = false;\n" + + " return %s;") % (varName, retval) return """ { XPCWrappedNativeScope* scope = XPCWrappedNativeScope::FindInJSObjectScope(aCx, %s); if (!scope) { - return %s; +%s } if (!scope->ExperimentalBindingsEnabled()) { -%s %s = false; - return %s; +%s%s } } -""" % (globalName, retval, wrapperCache, varName, retval) +""" % (globalName, failureCode, wrapperCache, failureCode) class CGDefineDOMInterfaceMethod(CGAbstractMethod): """