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

Proposed by Matthias Brantner
Status: Merged
Approved by: Chris Hillery
Approved revision: 11224
Merged at revision: 11239
Proposed branch: lp:~zorba-coders/zorba/bug-1124273
Merge into: lp:zorba
Diff against target: 61 lines (+11/-10)
3 files modified
ChangeLog (+1/-0)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+5/-5)
src/compiler/parsetree/parsenode_print_xquery_visitor.cpp (+5/-5)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1124273
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Matthias Brantner Approve
Review via email: mp+148229@code.launchpad.net

Commit message

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

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1124273-2013-02-14T03-10-43.902Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-02-12 19:43:55 +0000
3+++ ChangeLog 2013-02-13 16:27:34 +0000
4@@ -19,6 +19,7 @@
5 collection).
6
7 Bug Fixes/Other Changes:
8+ * Fixed bug #1124273 (xqdoc crash because of annotation literals)
9 * Fixed bug #867027 (XQST0059 error messages inconsistent)
10 * Fixed bug #1095889 (Improve error message for xml-parsing error).
11 * Fixed bug #1122396 (Associate origin/destination URI to I/O stream)
12
13=== modified file 'src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp'
14--- src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-01-17 04:43:05 +0000
15+++ src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-02-13 16:27:34 +0000
16@@ -126,15 +126,15 @@
17 lAttrValue << " ";
18
19 exprnode* lLit = (*lLits)[j].getp();
20- Literal* l = static_cast<Literal*>(lLit);
21- if (l->get_type() == Literal::STRING_LITERAL)
22+ StringLiteral* l = dynamic_cast<StringLiteral*>(lLit);
23+ if (l)
24 {
25- StringLiteral* s = l->get_string_literal().getp();
26- lAttrValue << s->get_strval();
27+ lAttrValue << l->get_strval();
28 }
29 else
30 {
31- NumericLiteral* n = l->get_numeric_literal().getp();
32+ NumericLiteral* n = dynamic_cast<NumericLiteral*>(lLit);
33+ assert(n);
34 lAttrValue << n->toString();
35 }
36 }
37
38=== modified file 'src/compiler/parsetree/parsenode_print_xquery_visitor.cpp'
39--- src/compiler/parsetree/parsenode_print_xquery_visitor.cpp 2013-01-19 20:47:55 +0000
40+++ src/compiler/parsetree/parsenode_print_xquery_visitor.cpp 2013-02-13 16:27:34 +0000
41@@ -423,15 +423,15 @@
42 lAttrValue << " ";
43
44 exprnode* lLit = (*lLits)[j].getp();
45- Literal* l = static_cast<Literal*>(lLit);
46- if (l->get_type() == Literal::STRING_LITERAL)
47+ StringLiteral* l = dynamic_cast<StringLiteral*>(lLit);
48+ if (l)
49 {
50- StringLiteral* s = l->get_string_literal().getp();
51- lAttrValue << s->get_strval();
52+ lAttrValue << l->get_strval();
53 }
54 else
55 {
56- NumericLiteral* n = l->get_numeric_literal().getp();
57+ NumericLiteral* n = dynamic_cast<NumericLiteral*>(lLit);
58+ assert(n);
59 lAttrValue << n->toString();
60 }
61 }

Subscribers

People subscribed via source and target branches