I tried to narrow down the problem and segregated the smallest code snippet
which causes the problem. I am attaching my version here.
The code crashes while appling the += operator in STL code.
The following code works fine on Windows platform but crashes on MacOSX with
code warrior 8.3 with MSL STL.

Could any one suggest me what wrong in here.

Regards
Sanjay

#include "stdafx.h"
#include <deque>
#include <vector>
using namespace std;
typedef unsigned short  XalanDOMChar;
class  XalanNamespacesStack {
        public:
                class  XalanNamespacesStackEntry {
                public:
                        XalanNamespacesStackEntry();
                        XalanNamespacesStackEntry(const
XalanNamespacesStackEntry&      theSource);
                        //~XalanNamespacesStackEntry();
                        XalanNamespacesStackEntry&
                        operator=(const XalanNamespacesStackEntry&
theRHS);
                private:
                        typedef XalanDOMChar
value_type;
                        typedef std::deque<value_type>
NamespaceCollectionType;
                        typedef NamespaceCollectionType::iterator
iterator;
                        typedef NamespaceCollectionType::const_iterator
const_iterator;

                        NamespaceCollectionType         m_namespaces;
                        iterator
m_position;
                };

                typedef XalanNamespacesStackEntry       value_type;
                typedef std::deque<value_type>  NamespacesStackType;
                
                XalanNamespacesStack();
        private:
                XalanNamespacesStack(const XalanNamespacesStack&);
                bool
                operator==(const XalanNamespacesStack&) const;
                XalanNamespacesStack&
                operator=(const XalanNamespacesStack&);
                NamespacesStackType
m_resultNamespaces;
};
XalanNamespacesStack::XalanNamespacesStack() :
        m_resultNamespaces(1)
{
        // m_resultNamespaces is initialized to a size of
        // 1, so we always have a dummy entry at the
        // beginning.  This makes the implementation
        // much simpler.
}
XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry(c
onst XalanNamespacesStackEntry& theSource) :
m_namespaces(theSource.m_namespaces),
m_position(m_namespaces.begin() + (const_iterator(theSource.m_position) -
theSource.m_namespaces.begin()))
{
}
XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry()
:
        m_namespaces(),
        m_position(m_namespaces.begin())
{
}
class XSLTEngineImpl {
        XalanNamespacesStack                    m_resultNamespacesStack;
public:
        XSLTEngineImpl::XSLTEngineImpl();
};
XSLTEngineImpl::XSLTEngineImpl ():m_resultNamespacesStack(){
}


int main(int argc, char* argv[])
{
        XSLTEngineImpl obk;
        return 0;
}
>  -----Original Message-----
> From:         Sanjay Arora  
> Sent: Tuesday, May 04, 2004 4:18 PM
> To:   '[email protected]'
> Subject:      Crash while using transform method on MacOSX
> 
> Hi,
>       I am trying to Use Xalan-C on MacOSX with codewarrior 8.3.
> 
>       After making the FrameWork if I try to use the transform method of
> XalanTranformer class, the crash occurs on the following line
> 
> 
>       
> XalanNamespacesStack::XalanNamespacesStackEntry::XalanNamespacesStackEntry
> (const XalanNamespacesStackEntry& theSource) :
>       m_namespaces(theSource.m_namespaces),
>       m_position(m_namespaces.begin() +
> (const_iterator(theSource.m_position) - theSource.m_namespaces.begin()))
>       {
>       }
> 
> 
> The actual crash occurs in the MSL STL code. Could any one suggest me what
> might be the reason.
> Did any one tried to use Xalan-C on MacOSX?
> 
> Regards
> Sanjay

Reply via email to