[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Any C++ on Alpha gfurus out there?



Try this code :

const char * EV_UnixMenu::_getItemPath(AP_Menu_Id id) const
{
        for (UT_uint32 k=0; (k < m_nrActualFactoryItems); k++)
        {
                _wd * wd = (_wd *)m_menuFactoryItems[k].callback_action;
                if (wd)
                   if (wd->m_id==id)
                        return m_menuFactoryItems[k].path;
        }

There might be a problem in the order the if expression is evaluated : if wd is
NULL and wd->m_id is evaluated first... Crash !

Nicolas

Brian E.W. Wood wrote:

> I'm trying to compile the most recent versions of AbiWord, a promising project
> to create a GPL wysiwyg word processor.
>
> As of recent versions is has stopped working on my Alpha. It apparently
> comtinues to run on Intel machines.
>
> I'm definitely not a C++ programmer, but I'd like to try and find out what has
> happened.
>
> The program segfaults on the following bit of code:
>
> const char * EV_UnixMenu::_getItemPath(AP_Menu_Id id) const
> {
>         for (UT_uint32 k=0; (k < m_nrActualFactoryItems); k++)
>         {
>                 _wd * wd = (_wd *)m_menuFactoryItems[k].callback_action;
>                 if (wd && (wd->m_id==id))
>                         return m_menuFactoryItems[k].path;
>         }
>
> GDB says it segfaults at the if statement.
>
> UT_uint32 is defined in the header file:
>
> protected:
>         UT_uint32                       m_nrActualFactoryItems;
>         UT_Vector                       m_vecMenuWidgets;
>
> I realize that this is woefully inadequate information with which to diagnose
> the problem but I'm hoping somebody might have an inspired guess as to what
> direction I should proceed in. is the uint32 perhaps a problem on the alpha?
>
> Thanks.
>
> ---
> Brian E.W. Wood  beww@intac.com
>
> --
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []