Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

XALANC-736 Assertion failure in debug mode

git-svn-id: https://svn.apache.org/repos/asf/xalan/c/trunk@1442452 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit a5ff847323aadd22899fc9e16459da3513d970b7 1 parent 7ddab3b
authored February 05, 2013
35  src/xalanc/PlatformSupport/XalanParsedURI.cpp
@@ -119,8 +119,13 @@ void XalanParsedURI::parse(
119 119
         {
120 120
             ++index;
121 121
         }
122  
-        m_authority = XalanDOMString(uriString + authority, getMemoryManager(), index - authority);
123  
-        m_defined |= d_authority;
  122
+        if (index != authority)
  123
+        {
  124
+            m_authority = XalanDOMString(uriString + authority, getMemoryManager(), index - authority);
  125
+            m_defined |= d_authority;
  126
+        }
  127
+        else
  128
+            m_authority.clear();
124 129
     }
125 130
     else
126 131
     {
@@ -183,10 +188,16 @@ void XalanParsedURI::resolve(
183 188
     else if ((m_defined & (d_scheme | d_authority | d_query)) == 0 &&
184 189
         m_path.empty())
185 190
     {
186  
-        m_scheme    = base.m_scheme;
187  
-        m_authority = base.m_authority;
  191
+        m_defined = base.m_defined;
  192
+        if (base.m_defined & d_scheme)
  193
+            m_scheme    = base.m_scheme;
  194
+        if (base.m_defined & d_authority)
  195
+            m_authority = base.m_authority;
  196
+
188 197
         m_path      = base.m_path;
189  
-        m_query     = base.m_query;
  198
+
  199
+        if (base.m_defined & d_query)
  200
+            m_query     = base.m_query;
190 201
 
191 202
         // There is an error/unclarity in the specification in step 2 in that
192 203
         // it doesn't state that the fragment should be inherited; however
@@ -206,15 +217,21 @@ void XalanParsedURI::resolve(
206 217
             && equalsIgnoreCaseASCII(m_scheme, base.m_scheme)))
207 218
     {
208 219
         // Inherit the base scheme
209  
-        m_scheme = base.m_scheme;
210  
-        m_defined |= d_scheme;
  220
+        if (base.m_defined & d_scheme)
  221
+        {
  222
+            m_scheme = base.m_scheme;
  223
+            m_defined |= d_scheme;
  224
+        }
211 225
 
212 226
         // Step 4: If the authority is unm_defined then inherit it, otherwise skip to step 7
213 227
         if (!(m_defined & d_authority))
214 228
         {
215 229
             // Inherit the base authority
216  
-            m_authority = base.m_authority;
217  
-            m_defined |= d_authority;
  230
+            if (base.m_defined & d_authority)
  231
+            {
  232
+                m_authority = base.m_authority;
  233
+                m_defined |= d_authority;
  234
+            }
218 235
 
219 236
             // Step 5: if the path starts with a / then it is absolute
220 237
             if (!(m_path.length() > 0 && m_path[0] == XalanUnicode::charSolidus))

0 notes on commit a5ff847

Please sign in to comment.
Something went wrong with that request. Please try again.