From e6c9d9144ec777e2b4984e35ea88eea0915c5f06 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Thu, 7 May 2015 09:51:06 -0700 Subject: [PATCH] Bug 1162318 - Rooting hazard in WrapNativeParentHelper, r=peterv --- dom/bindings/BindingUtils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 6fc2edf2801..2780032a987 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -1540,8 +1540,10 @@ struct WrapNativeParentHelper JSObject* obj; if (cache && (obj = cache->GetWrapper())) { #ifdef DEBUG - NS_ASSERTION(WrapNativeISupportsParent(cx, parent, cache) == obj, + JS::Rooted rootedObj(cx, obj); + NS_ASSERTION(WrapNativeISupportsParent(cx, parent, cache) == rootedObj, "Unexpected object in nsWrapperCache"); + obj = rootedObj; #endif return obj; }