← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/bug-1124273 into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/bug-1124273 into lp:zorba.

Commit message:
fix for bug 1124273 (xqdoc crash because of annotation literals)

Requested reviews:
  Chris Hillery (ceejatec)
Related bugs:
  Bug #1124273 in Zorba: "xqdoc crash because of annotation literals"
  https://bugs.launchpad.net/zorba/+bug/1124273

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1124273/+merge/148229
-- 
https://code.launchpad.net/~zorba-coders/zorba/bug-1124273/+merge/148229
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2013-02-12 19:43:55 +0000
+++ ChangeLog	2013-02-13 16:27:34 +0000
@@ -19,6 +19,7 @@
     collection).
 
 Bug Fixes/Other Changes:
+  * Fixed bug #1124273 (xqdoc crash because of annotation literals)
   * Fixed bug #867027 (XQST0059 error messages inconsistent)
   * Fixed bug #1095889 (Improve error message for xml-parsing error).
   * Fixed bug #1122396 (Associate origin/destination URI to I/O stream)

=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp	2013-01-17 04:43:05 +0000
+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp	2013-02-13 16:27:34 +0000
@@ -126,15 +126,15 @@
             lAttrValue << " ";
 
           exprnode* lLit = (*lLits)[j].getp();
-          Literal* l = static_cast<Literal*>(lLit);
-          if (l->get_type() == Literal::STRING_LITERAL)
+          StringLiteral* l = dynamic_cast<StringLiteral*>(lLit);
+          if (l)
           {
-            StringLiteral* s = l->get_string_literal().getp();
-            lAttrValue << s->get_strval();
+            lAttrValue << l->get_strval();
           }
           else
           {
-            NumericLiteral* n = l->get_numeric_literal().getp();
+            NumericLiteral* n = dynamic_cast<NumericLiteral*>(lLit);
+            assert(n);
             lAttrValue << n->toString();
           }
         }

=== modified file 'src/compiler/parsetree/parsenode_print_xquery_visitor.cpp'
--- src/compiler/parsetree/parsenode_print_xquery_visitor.cpp	2013-01-19 20:47:55 +0000
+++ src/compiler/parsetree/parsenode_print_xquery_visitor.cpp	2013-02-13 16:27:34 +0000
@@ -423,15 +423,15 @@
             lAttrValue << " ";
 
           exprnode* lLit = (*lLits)[j].getp();
-          Literal* l = static_cast<Literal*>(lLit);
-          if (l->get_type() == Literal::STRING_LITERAL)
+          StringLiteral* l = dynamic_cast<StringLiteral*>(lLit);
+          if (l)
           {
-            StringLiteral* s = l->get_string_literal().getp();
-            lAttrValue << s->get_strval();
+            lAttrValue << l->get_strval();
           }
           else
           {
-            NumericLiteral* n = l->get_numeric_literal().getp();
+            NumericLiteral* n = dynamic_cast<NumericLiteral*>(lLit);
+            assert(n);
             lAttrValue << n->toString();
           }
         }


Follow ups