From d5cca305bdf40522526caa785e8befc13339b1e4 Mon Sep 17 00:00:00 2001 From: "daumling%adobe.com" Date: Wed, 15 Mar 2006 09:23:36 +0000 Subject: [PATCH] Bug 330169: Replaced early exits in ParseNodeToXML() with a jump to skip_child so js_LeaveLocalRootScope() can be called correctly. r=mrbkap --- js/src/jsxml.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/src/jsxml.c b/js/src/jsxml.c index 977575142481..05990f38e59a 100644 --- a/js/src/jsxml.c +++ b/js/src/jsxml.c @@ -1758,7 +1758,7 @@ ParseNodeToXML(JSContext *cx, JSParseNode *pn, JSXMLArray *inScopeNSes, qn = NULL; if (pn->pn_type == TOK_XMLCOMMENT) { if (flags & XSF_IGNORE_COMMENTS) - return PN2X_SKIP_CHILD; + goto skip_child; xml_class = JSXML_CLASS_COMMENT; } else if (pn->pn_type == TOK_XMLPI) { if (IS_XML(str)) { @@ -1771,7 +1771,7 @@ ParseNodeToXML(JSContext *cx, JSParseNode *pn, JSXMLArray *inScopeNSes, } if (flags & XSF_IGNORE_PROCESSING_INSTRUCTIONS) - return PN2X_SKIP_CHILD; + goto skip_child; qn = ParseNodeToQName(cx, pn, inScopeNSes, JS_FALSE); if (!qn) @@ -1804,6 +1804,10 @@ ParseNodeToXML(JSContext *cx, JSParseNode *pn, JSXMLArray *inScopeNSes, return NULL; return xml; +skip_child: + js_LeaveLocalRootScope(cx); + return PN2X_SKIP_CHILD; + #undef PN2X_SKIP_CHILD syntax: