Merge lp:~zorba-coders/zorba/bug867156-importsegfaults into lp:zorba

Proposed by Cezar Andrei
Status: Merged
Approved by: Cezar Andrei
Approved revision: 10787
Merged at revision: 10789
Proposed branch: lp:~zorba-coders/zorba/bug867156-importsegfaults
Merge into: lp:zorba
Diff against target: 27 lines (+9/-1)
1 file modified
src/compiler/translator/translator.cpp (+9/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug867156-importsegfaults
Reviewer Review Type Date Requested Status
Chris Hillery Approve
Cezar Andrei Approve
Review via email: mp+103172@code.launchpad.net

This proposal supersedes a proposal from 2012-04-23.

Commit message

According to Xerces-C++ team( http://issues.apache.org/jira/browse/XERCESC-1980 ) XMLSchema.xsd i.e. schema4schema should be avoided to be imported. This fix avoids importing this schema file.

Description of the change

According to Xerces-C++ team( http://issues.apache.org/jira/browse/XERCESC-1980 ) XMLSchema.xsd i.e. schema4schema should be avoided to be imported. This fix avoids importing this schema file.

To post a comment you must log in.
Revision history for this message
Cezar Andrei (cezar-andrei) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Chris Hillery (ceejatec) wrote : Posted in a previous version of this proposal

Could you add a URL in the code comment pointing to a Xerces mailing list
discussion or other page where it is mentioned that you shouldn't import
schema for schema? I suspect that is something that will surprise anyone
who looks at the Zorba source code later, so it would be good to have
third-party confirmation.

Ceej
aka Chris Hillery
On Apr 23, 2012 1:48 PM, "Cezar Andrei" <email address hidden> wrote:

> The proposal to merge lp:~zorba-coders/zorba/bug867156-importsegfaults
> into lp:zorba has been updated.
>
> Status: Needs review => Approved
>
> For more details, see:
>
> https://code.launchpad.net/~zorba-coders/zorba/bug867156-importsegfaults/+merge/103169
> --
>
> https://code.launchpad.net/~zorba-coders/zorba/bug867156-importsegfaults/+merge/103169
> You are requested to review the proposed merge of
> lp:~zorba-coders/zorba/bug867156-importsegfaults into lp:zorba.
>

Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

Done.

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Cezar Andrei (cezar-andrei) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug867156-importsegfaults-2012-04-23T21-34-13.402Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

There are already plenty of definitions for the XMLSchema URI. I think it would make sense to reuse the one from src/zorbamisc/ns_consts.h.

review: Needs Fixing
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/compiler/translator/translator.cpp'
2--- src/compiler/translator/translator.cpp 2012-04-23 10:46:38 +0000
3+++ src/compiler/translator/translator.cpp 2012-04-23 21:19:20 +0000
4@@ -105,7 +105,7 @@
5
6
7 #define NODE_SORT_OPT
8-
9+#define XS_URI "http://www.w3.org/2001/XMLSchema"
10
11 namespace zorba
12 {
13@@ -2011,6 +2011,14 @@
14 theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033);
15 }
16
17+ zstring xsdTNS = zstring(XS_URI);
18+ if ( xsdTNS.compare(targetNS)==0 )
19+ {
20+ // Xerces doesn't like importing XMLSchema.xsd schema4schema, so we skip it
21+ // see Xerces-C++ bug: https://issues.apache.org/jira/browse/XERCESC-1980
22+ return no_state;
23+ }
24+
25 store::Item_t targetNSItem = NULL;
26 zstring tmp = targetNS;
27 ITEM_FACTORY->createAnyURI(targetNSItem, tmp);

Subscribers

People subscribed via source and target branches