Hello all,
Seems that I've discovered an assertion failure with this code: >-----------------------<cut>-------------------------< #include <xalanc/XalanTransformer/XalanTransformer.hpp> #include <xalanc/XalanDOM/XalanDOMString.hpp> XALAN_USING(XALAN_CPP_NAMESPACE, XalanDOMString) int main(void) { XALAN_USING_XERCES(XMLPlatformUtils) XALAN_USING_XALAN(XalanTransformer) XMLPlatformUtils::Initialize(); XalanTransformer::initialize(); XalanDOMString a("xxxxxxxxxxx"), b; a.substr(b); //the same as a.substr(b, 0, XalanDOMString::npos); return 0; } >-----------------------<cut>-------------------------< Here goes the output: >-----------------------<cut>-------------------------< Assertion failed: thePosition < theSource.size() && thePosition + theCount <= theSource.size(), file /u02/home/avinokur/xalan-c/xml-xalan/c/src/xalanc/XalanDOM/XalanDOMString.cp p, line 224 Abort (core dumped) >-----------------------<cut>-------------------------< I use 1.10.0 version of Xalan-C, and compile it on SunOS 5.9 Generic_118558-30 sun4u sparc SUNW,Sun-Fire-280R. As I've found the assertion fails in "thePosition + theCount <= theSource.size()" code, computing it to "0 + 4294967295 <= 11". Trying "a.substr(b, 1)", the condition will be "1 + 4294967295 <= 11" which is "0 < 11" due to "typedef unsigned int size_type;" code from ``xalanc/XalanDOM/XalanDOMString.hpp''. Is it a bug or my misunderstanding of smth? With best regards, Aleksandr Vinokurov.