bug 305883: Protect against the empty XML list to fix a crash when emitting code for |<></>|. Also fix the decompiler to handle XMLLists correctly. r+a=brendan

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@179105 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2005-08-26 21:16:15 +00:00
parent 415de0172e
commit 67e4462827
2 changed files with 6 additions and 2 deletions

View File

@@ -4709,7 +4709,7 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
}
JS_ASSERT(pn->pn_type == TOK_XMLLIST || pn->pn_count != 0);
switch (pn->pn_head->pn_type) {
switch (pn->pn_head ? pn->pn_head->pn_type : TOK_XMLLIST) {
case TOK_XMLETAGO:
JS_ASSERT(0);
/* FALL THROUGH */

View File

@@ -2560,8 +2560,12 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
quoteAttr = JS_FALSE;
break;
case JSOP_TOXML:
case JSOP_TOXMLLIST:
todo = Sprint(&ss->sprinter, "<>%s</>", POP_STR());
inXML = JS_FALSE;
break;
case JSOP_TOXML:
inXML = JS_FALSE;
/* fall through */