ASTPrinter: Support empty goto case;

support goto case; with out an expression.

currently running dscanner --ast std/d/parser.d fails with a segfault
This commit is contained in:
Liran Zvibel 2014-04-24 21:05:00 +03:00
parent 3a78e4b937
commit fb6116c041
1 changed files with 3 additions and 1 deletions

View File

@ -592,7 +592,9 @@ class XMLPrinter : ASTVisitor
{
output.writeln("<gotoStatement>");
output.writeln("<case>");
visit(gotoStatement.expression);
if (gotoStatement.expression) {
visit(gotoStatement.expression);
}
output.writeln("</case>");
output.writeln("</gotoStatement>");
}